コード例 #1
0
 public override bool IsComplex()
 {
     foreach (object obj in this.Expressions)
     {
         Expression expression = (Expression)obj;
         if (expression.IsComplex())
         {
             return(true);
         }
     }
     return(base.GetFixedWidth() <= 0);
 }
コード例 #2
0
        public override void Compile(ICompiler cmp, bool reverse)
        {
            if (Expression.IsComplex())
            {
                LinkRef until = cmp.NewLink();

                cmp.EmitRepeat(min, max, lazy, until);
                Expression.Compile(cmp, reverse);
                cmp.EmitUntil(until);
            }
            else
            {
                LinkRef tail = cmp.NewLink();

                cmp.EmitFastRepeat(min, max, lazy, tail);
                Expression.Compile(cmp, reverse);
                cmp.EmitTrue();
                cmp.ResolveLink(tail);
            }
        }