本文整理汇总了C#中System.Text.RegularExpressions.RegexNode.UseOptionR方法的典型用法代码示例。如果您正苦于以下问题:C# RegexNode.UseOptionR方法的具体用法?C# RegexNode.UseOptionR怎么用?C# RegexNode.UseOptionR使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Text.RegularExpressions.RegexNode
的用法示例。
在下文中一共展示了RegexNode.UseOptionR方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EmitFragment
/// <summary>
/// The main RegexCode generator. It does a depth-first walk
/// through the tree and calls EmitFragment to emits code before
/// and after each child of an interior node, and at each leaf.
/// </summary>
private void EmitFragment(int nodetype, RegexNode node, int curIndex)
{
int bits = 0;
if (nodetype <= RegexNode.Ref)
{
if (node.UseOptionR())
bits |= RegexCode.Rtl;
if ((node._options & RegexOptions.IgnoreCase) != 0)
bits |= RegexCode.Ci;
}
switch (nodetype)
{
case RegexNode.Concatenate | BeforeChild:
case RegexNode.Concatenate | AfterChild:
case RegexNode.Empty:
break;
case RegexNode.Alternate | BeforeChild:
if (curIndex < node._children.Count - 1)
{
PushInt(CurPos());
Emit(RegexCode.Lazybranch, 0);
}
break;
case RegexNode.Alternate | AfterChild:
{
if (curIndex < node._children.Count - 1)
{
int LBPos = PopInt();
PushInt(CurPos());
Emit(RegexCode.Goto, 0);
PatchJump(LBPos, CurPos());
}
else
{
int I;
for (I = 0; I < curIndex; I++)
{
PatchJump(PopInt(), CurPos());
}
}
break;
}
case RegexNode.Testref | BeforeChild:
switch (curIndex)
{
case 0:
Emit(RegexCode.Setjump);
PushInt(CurPos());
Emit(RegexCode.Lazybranch, 0);
Emit(RegexCode.Testref, MapCapnum(node._m));
Emit(RegexCode.Forejump);
break;
}
break;
case RegexNode.Testref | AfterChild:
switch (curIndex)
{
case 0:
{
int Branchpos = PopInt();
PushInt(CurPos());
Emit(RegexCode.Goto, 0);
PatchJump(Branchpos, CurPos());
Emit(RegexCode.Forejump);
if (node._children.Count > 1)
break;
// else fallthrough
goto case 1;
}
case 1:
PatchJump(PopInt(), CurPos());
break;
}
break;
case RegexNode.Testgroup | BeforeChild:
switch (curIndex)
{
case 0:
Emit(RegexCode.Setjump);
Emit(RegexCode.Setmark);
PushInt(CurPos());
Emit(RegexCode.Lazybranch, 0);
break;
}
break;
case RegexNode.Testgroup | AfterChild:
switch (curIndex)
//.........这里部分代码省略.........
示例2: EmitFragment
internal void EmitFragment(int nodetype, RegexNode node, int CurIndex)
{
int num = 0;
if (nodetype <= 13)
{
if (node.UseOptionR())
{
num |= 0x40;
}
if ((node._options & RegexOptions.IgnoreCase) != RegexOptions.None)
{
num |= 0x200;
}
}
int num8 = nodetype;
switch (num8)
{
case 3:
case 4:
case 6:
case 7:
if (node._m > 0)
{
this.Emit((((node._type == 3) || (node._type == 6)) ? 0 : 1) | num, node._ch, node._m);
}
if (node._n > node._m)
{
this.Emit(node._type | num, node._ch, (node._n == 0x7fffffff) ? 0x7fffffff : (node._n - node._m));
}
return;
case 5:
case 8:
if (node._m > 0)
{
this.Emit(2 | num, this.StringCode(node._str), this.StringCode(node._str2), node._m);
}
if (node._n > node._m)
{
this.Emit(node._type | num, this.StringCode(node._str), this.StringCode(node._str2), (node._n == 0x7fffffff) ? 0x7fffffff : (node._n - node._m));
}
return;
case 9:
case 10:
this.Emit(node._type | num, node._ch);
return;
case 11:
this.Emit(node._type | num, this.StringCode(node._str), this.StringCode(node._str2));
return;
case 12:
this.Emit(node._type | num, this.StringCode(node._str));
return;
case 13:
this.Emit(node._type | num, this.MapCapnum(node._m));
return;
case 14:
case 15:
case 0x10:
case 0x11:
case 0x12:
case 0x13:
case 20:
case 0x15:
case 0x16:
case 0x29:
case 0x2a:
this.Emit(node._type);
return;
case 0x17:
case 0x59:
case 0x5d:
case 0x99:
case 0x9d:
return;
case 0x58:
if (CurIndex < (node._children.Count - 1))
{
this.PushInt(this.CurPos());
this.Emit(0x17, 0);
}
return;
case 90:
case 0x5b:
if ((node._n >= 0x7fffffff) && (node._m <= 1))
{
this.Emit((node._m == 0) ? 30 : 0x1f);
}
else
{
this.Emit((node._m == 0) ? 0x1a : 0x1b, (node._m == 0) ? 0 : (1 - node._m));
}
if (node._m == 0)
//.........这里部分代码省略.........