Enhanced C#
Language of your choice: library documentation
Public static fields | Public Member Functions | Protected Member Functions | Protected fields | List of all members
Loyc.Syntax.Les.Les2Parser Class Reference

Parses LES (Loyc Expression Syntax) code into a sequence of Loyc trees (LNode), one per top-level statement. More...


Source files:
Inheritance diagram for Loyc.Syntax.Les.Les2Parser:
Loyc.Syntax.BaseParserForList< Token, int > Loyc.Syntax.Les.Les3Parser

Remarks

Parses LES (Loyc Expression Syntax) code into a sequence of Loyc trees (LNode), one per top-level statement.

You can use Les2LanguageService.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 Les2Lexer that have been preprocessed by TokensToTree, with whitespace tokens filtered out.

Public static fields

static readonly Precedence StartStmt = Precedence.MinValue
 

Public Member Functions

 Les2Parser (IListAndListSource< Token > tokens, ISourceFile file, IMessageSink messageSink)
 
 Les2Parser (IListSource< Token > tokens, ISourceFile file, IMessageSink messageSink)
 
 Les2Parser (IList< Token > tokens, ISourceFile file, IMessageSink messageSink, int startIndex=0)
 
void Reset (IList< Token > list, ISourceFile file, int startIndex=0)
 
IEnumerable< LNodeStart (Holder< TokenType > separator)
 Top-level rule: expects a sequence of statements followed by EOF More...
 
VList< LNodeExprList (VList< LNode > list=default(VList< LNode >))
 
VList< LNodeStmtList ()
 
virtual VList< LNodeExprList (ref TokenType endMarker, VList< LNode > list=default(VList< LNode >))
 
virtual IEnumerable< LNodeExprListLazy (Holder< TokenType > endMarker)
 

Protected Member Functions

override void Reset (IList< Token > list, Token eofToken, ISourceFile file, int startIndex=0)
 
override string ToString (int type)
 
LNode MissingExpr (Token tok)
 
Symbol ToSuffixOpName (object symbol)
 
Precedence PrefixPrecedenceOf (Token t)
 
Precedence SuffixPrecedenceOf (Token t)
 
Precedence InfixPrecedenceOf (Token t)
 
virtual LNode MarkSpecial (LNode n)
 
virtual LNode MarkCall (LNode n)
 
override void Error (bool inverted, IEnumerable< int > expected_)
 
LNode TopExpr ()
 

Protected fields

LNodeFactory F
 
LesPrecedenceMap _prec = LesPrecedenceMap.Default
 

Member Function Documentation

IEnumerable<LNode> Loyc.Syntax.Les.Les2Parser.Start ( Holder< TokenType >  separator)
inline

Top-level rule: expects a sequence of statements followed by EOF

Referenced by Loyc.Syntax.Les.Les2LanguageService.Parse(), and Loyc.Syntax.Les.Les3LanguageService.Parse().