Enhanced C#
Language of your choice: library documentation
Properties | Public Member Functions | List of all members
Loyc.Syntax.Lexing.ILllpgApi< Token, MatchType, LaType > Interface Template Reference

For reference purposes, this interface is a list of the non-static methods that LLLPG expects to be able to call when it is generating code. LLLPG does not actually need lexers and parsers to implement this interface; they simply need to implement the same set of methods as this interface contains. More...


Source file:

Remarks

For reference purposes, this interface is a list of the non-static methods that LLLPG expects to be able to call when it is generating code. LLLPG does not actually need lexers and parsers to implement this interface; they simply need to implement the same set of methods as this interface contains.

Template Parameters
TokenThe return value of the Match methods. LLLPG does not care and does not need to know what this type is. In lexers, these methods typically return the character that was matched (i.e. int, because EOF is -1), and in parsers they should return the token that was matched.
MatchTypeThe data type of arguments to Match, MatchExcept, TryMatch and TryMatchExcept. In lexers, MatchType is always int. In parsers, by default, LLLPG generates code as though MatchType is same as LaType, but one often uses int instead, e.g. because enums do not implement IEquatable<T> as required by BaseParser<Token,MatchType>. you're using BaseParser<Token,MatchType> with LaType=int token type is an enum, which for some reason does not implement IEquatable{T}. So, often, when using BaseParser{Token you need to use the matchType(int) option to change MatchType to int.
LaTypeThe data type of LA0 and LA(i). This is always int in lexers, but in parsers you can use the laType(...) option to change this type.
See also
ILllpgLexerApi<Char>

Properties

LaType LA0 [get]
 

Public Member Functions

LaType LA (int i)
 
void Error (int lookaheadIndex, string message)
 
void Skip ()
 
Token MatchAny ()
 
Token Match (MatchType a)
 
Token Match (MatchType a, MatchType b)
 
Token Match (MatchType a, MatchType b, MatchType c)
 
Token Match (MatchType a, MatchType b, MatchType c, MatchType d)
 
Token Match (HashSet< MatchType > set)
 
Token MatchExcept ()
 
Token MatchExcept (MatchType a)
 
Token MatchExcept (MatchType a, MatchType b)
 
Token MatchExcept (MatchType a, MatchType b, MatchType c)
 
Token MatchExcept (MatchType a, MatchType b, MatchType c, MatchType d)
 
Token MatchExcept (HashSet< MatchType > set)
 
void Check (bool expectation, string expectedDescr)
 
bool TryMatch (MatchType a)
 
bool TryMatch (MatchType a, MatchType b)
 
bool TryMatch (MatchType a, MatchType b, MatchType c)
 
bool TryMatch (MatchType a, MatchType b, MatchType c, MatchType d)
 
bool TryMatch (HashSet< MatchType > set)
 
bool TryMatchExcept ()
 
bool TryMatchExcept (MatchType a)
 
bool TryMatchExcept (MatchType a, MatchType b)
 
bool TryMatchExcept (MatchType a, MatchType b, MatchType c)
 
bool TryMatchExcept (MatchType a, MatchType b, MatchType c, MatchType d)
 
bool TryMatchExcept (HashSet< MatchType > set)