Enhanced C#
Language of your choice: library documentation
Loyc.Syntax.BaseParserNoBacktracking< Token, Enumerator > Class Template Reference

An base class designed for parsers that use LLLPG (Loyc LL(k) Parser Generator) and receive tokens from any IEnumerator<Token>. More...


Source file:

Remarks

An base class designed for parsers that use LLLPG (Loyc LL(k) Parser Generator) and receive tokens from any IEnumerator<Token>.

This base class for LLLPG parsers simply requires an enumerator to work, and it has a small buffer to hold lookahead tokens. Old tokens are forgotten, so this base class does not support backtracking (i.e. syntactic predicates), but it can save memory. Please use BaseParserForList<Tok,La> if your input sequence comes in the form of a list.

This version of BaseParser has Enumerator as a generic parameter. Compared to using IEnumerator{Token} directly, this can increase performance in case Enumerator is a value type (e.g. List<Token>.Enumerator).

(I wrote this class by mistake... I actually forgot about backtracking!)

Type Constraints
Token :ISimpleToken 
Enumerator :IEnumerator<Token>