Beispiel #1
0
        internal bool ConsumeOptionalTerm(Terms.Terminal term)
        {
            ConsumeWhiteSpace();

            var tok = term.GetToken(Input, _index);
            if (tok == null)
                return false;

            ConsumeToken(tok);
            return true;
        }
Beispiel #2
0
        internal void ConsumeTerm(Terms.Terminal term)
        {
            ConsumeWhiteSpace();

            var tok = term.GetToken(Input, _index);
            if (tok == null)
                throw UnexpectedText(term.TokenType);

            ConsumeToken(tok);
        }
Beispiel #3
0
 internal bool IsNextTerm(Terms.Terminal term)
 {
     ConsumeWhiteSpace();
     return term.GetToken(Input, _index) != null;
 }