예제 #1
0
 public RuleResult(bool success, TokenStreamIndex index, int stepCount, TokenStreamSpan match)
 {
     IsSuccess = success;
     Index     = index;
     StepCount = stepCount;
     Match     = match;
 }
예제 #2
0
 internal RuleState(IRuleRef rule, TokenStreamIndex index, IRuleOperations coroutines, RuleState <TNode>?parent)
 {
     Rule        = (IRuleRef <TNode>)rule;
     Result      = new CoroutineResult <RuleResult>();
     NodeContext = new NodeContext <TNode>();
     Parent      = parent;
     RuleContext = new RuleContext(Rule, index, coroutines);
     Iterator    = rule.Grab(RuleContext).GetEnumerator();
 }
예제 #3
0
        public TokenStreamSpan Until(TokenStreamIndex end)
        {
            if (end.Index < Index)
            {
                throw new IndexOutOfRangeException();
            }

            return(new TokenStreamSpan(Stream, Index, end.Index));
        }