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 >

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...
 
LNodeList ExprList (LNodeList list=default(LNodeList))
 
LNodeList StmtList ()
 
virtual LNodeList ExprList (ref TokenType endMarker, LNodeList list=default(LNodeList))
 
virtual IEnumerable< LNodeExprListLazy (Holder< TokenType > endMarker)
 

Protected Member Functions

override void Reset (IList< Token > list, Func< Token, Token > getEofToken, int eof, 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 MatchError (bool inverted, IEnumerable< int > expected_)
 
LNode TopExpr ()
 

Protected fields

LNodeFactory F
 
Les2PrecedenceMap _prec = Les2PrecedenceMap.Default
 

Member Function Documentation

◆ Start()

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().