Parses LES (Loyc Expression Syntax) code into a sequence of Loyc trees (LNode), one per top-level statement.
You can use LesLanguageService.Value with ParsingService.Parse to easily parse a text string (holding zero or more LES statements) into a Loyc tree.
This class expects to receive tokens from LesLexer that have been preprocessed by TokensToTree, with whitespace tokens filtered out.
|
override void | Reset (IList< Token > list, Token eofToken, ISourceFile file, int startIndex=0) |
|
override string | ToString (int type) |
|
LNode | MissingExpr () |
|
virtual LNode | MarkSpecial (LNode n) |
|
virtual LNode | MarkCall (LNode n) |
|
override void | Error (bool inverted, IEnumerable< int > expected_) |
|
LNode | TopExpr () |
|
| BaseParserForList (IList< Token > list, Token eofToken, ISourceFile file, int startIndex=0) |
| <inheridoc>
|
|
| BaseParserForList (IListAndListSource< Token > list, Token eofToken, ISourceFile file, int startIndex=0) |
|
| BaseParserForList (IListSource< Token > list, Token eofToken, ISourceFile file, int startIndex=0) |
|
| BaseParserForList (IEnumerable< Token > list, Token eofToken, ISourceFile file, int startIndex=0) |
| <inheridoc>
|
|
| BaseParserForList (IEnumerator< Token > list, Token eofToken, ISourceFile file, int startIndex=0) |
| <inheridoc>
|
|
| BaseParserForList (List list, Token eofToken, ISourceFile file, int startIndex=0) |
| Initializes this object to begin parsing the specified tokens. More...
|
|
virtual void | Reset (List list, Token eofToken, ISourceFile file, int startIndex=0) |
| Reinitializes the object. This method is called by the constructor. More...
|
|
void | Reset () |
|
sealed override MatchType | EofInt () |
| Returns the value used for EOF (normally 0) More...
|
|
sealed override Token | LT (int i) |
| Returns the token at lookahead i (e.g. Source[InputPosition + i] if the tokens come from a list called Source) More...
|
|
MatchType | LA (int i) |
|
abstract override string | ToString (MatchType tokenType) |
| Returns a string representation of the specified token type. These strings are used in error messages. More...
|
|
bool | Down (List children) |
| Switches to parsing the specified token list at position zero (typically the value of Loyc.Syntax.Lexing.Token.Children in a token tree produced by TokensToTree.) The original token list and the original InputPosition are placed on a stack, so you can restore the old list by calling Up(). More...
|
|
void | Up () |
| Returns to the old token list saved by Down. More...
|
|
T | Up< T > (T value) |
| Calls Up() and returns value . More...
|
|
| BaseParser (ISourceFile file=null, int startIndex=0) |
|
virtual int | LaIndexToCharIndex (int lookaheadIndex) |
| Converts a lookahead token index to a character index (used for error reporting). More...
|
|
virtual object | LaIndexToSourcePos (int lookaheadIndex) |
| Converts a lookahead token index to a SourcePos object using LaIndexToCharIndex and SourceFile. More...
|
|
virtual void | Error (int lookaheadIndex, string message) |
| Records an error or throws an exception. More...
|
|
virtual void | Error (int lookaheadIndex, string format, params object[] args) |
|
void | Skip () |
|
Token | MatchAny () |
|
Token | Match (HashSet< MatchType > set, bool inverted=false) |
|
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 | 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) |
|
bool | TryMatch (HashSet< MatchType > set, bool inverted=false) |
|
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 | 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) |
|
void | Error (bool inverted, params MatchType[] expected) |
|
virtual void | Error (bool inverted, IEnumerable< MatchType > expected) |
|
virtual string | ToString (bool inverted, IEnumerable< MatchType > expected) |
|
virtual void | Check (bool expectation, string expectedDescr="") |
|