scripts
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002E4 RID: 740
|
||||
internal class Alternation : CompositeExpression
|
||||
{
|
||||
// Token: 0x17000837 RID: 2103
|
||||
// (get) Token: 0x06001AE3 RID: 6883 RVA: 0x000630D8 File Offset: 0x000612D8
|
||||
public ExpressionCollection Alternatives
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Expressions;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001AE4 RID: 6884 RVA: 0x000630E0 File Offset: 0x000612E0
|
||||
public void AddAlternative(Expression e)
|
||||
{
|
||||
this.Alternatives.Add(e);
|
||||
}
|
||||
|
||||
// Token: 0x06001AE5 RID: 6885 RVA: 0x000630F0 File Offset: 0x000612F0
|
||||
public override void Compile(ICompiler cmp, bool reverse)
|
||||
{
|
||||
LinkRef linkRef = cmp.NewLink();
|
||||
foreach (object obj in this.Alternatives)
|
||||
{
|
||||
Expression expression = (Expression)obj;
|
||||
LinkRef linkRef2 = cmp.NewLink();
|
||||
cmp.EmitBranch(linkRef2);
|
||||
expression.Compile(cmp, reverse);
|
||||
cmp.EmitJump(linkRef);
|
||||
cmp.ResolveLink(linkRef2);
|
||||
cmp.EmitBranchEnd();
|
||||
}
|
||||
cmp.EmitFalse();
|
||||
cmp.ResolveLink(linkRef);
|
||||
cmp.EmitAlternationEnd();
|
||||
}
|
||||
|
||||
// Token: 0x06001AE6 RID: 6886 RVA: 0x000631A0 File Offset: 0x000613A0
|
||||
public override void GetWidth(out int min, out int max)
|
||||
{
|
||||
base.GetWidth(out min, out max, this.Alternatives.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user