C# Class Parse.ParserState

Show file Open project: YourLocalFax/OLD-Score Class Usage Examples

Private Properties

Property Type Description
Advance void
AdvanceOp void
AdvanceOp void
Backup void
Check bool
CheckBuiltin bool
CheckIdent bool
CheckOp bool
CheckOp bool
CheckOp bool
Expect bool
ExpectIdent Lex.Token
ExpectOp bool
ExpectOp bool
GetIdent string
GetLastSpan Source.Span
GetOp string
GetSpan Source.Span
NextCheck bool
ParseBlock List
ParseCommaList List
ParseExpr NodeExpr
ParseFn SyntaxTree.NodeFnDecl
ParseFnBody FnBody
ParseFnDecl void
ParseInfix NodeExpr
ParseInvoke NodeExpr
ParseLet SyntaxTree.NodeLet
ParseMods Modifiers
ParseParameter SyntaxTree.Data.Parameter
ParseParameterList ParameterList
ParsePrimaryExpr NodeExpr
ParseRet SyntaxTree.NodeRet
ParseTy Spanned
ParseTypeDef SyntaxTree.NodeTypeDef
Peek Lex.Token

Public Methods

Method Description
ParseTopLevel ( ) : Node

This can return any top level node, but should only like statements.

ParserState ( DetailLogger log, TokenList tokens, string fileName ) : System.Collections.Generic

Private Methods

Method Description
Advance ( ) : void
AdvanceOp ( TokenType opType ) : void
AdvanceOp ( string image ) : void
Backup ( ) : void
Check ( TokenType type ) : bool
CheckBuiltin ( ) : bool
CheckIdent ( ) : bool
CheckOp ( ) : bool
CheckOp ( TokenType opType ) : bool
CheckOp ( string image ) : bool
Expect ( TokenType type, string message ) : bool
ExpectIdent ( string format ) : Token
ExpectOp ( TokenType opType, string message ) : bool
ExpectOp ( string image, string message ) : bool
GetIdent ( ) : string
GetLastSpan ( ) : Span
GetOp ( ) : string
GetSpan ( ) : Span
NextCheck ( TokenType type ) : bool
ParseBlock ( ) : List
ParseCommaList ( bool &trailingComma ) : List
ParseExpr ( bool isEnclosed = false, bool doError = true ) : NodeExpr
ParseFn ( Modifiers mods ) : NodeFnDecl

This can return either a NodeFN or a NodeFnDecl, depending on the precense of a body. This can still return a NodeFn for extern fns, it'll just end up being an error later (unless I do some kinda neat thing with bodied externs?)

ParseFnBody ( ) : FnBody
ParseFnDecl ( NodeFnDecl fn ) : void

This starts at the 'fn' keyword and reads until the return type.

ParseInfix ( NodeExpr left, bool isEnclosed ) : NodeExpr
ParseInvoke ( NodeExpr node, bool isEnclosed ) : NodeExpr
ParseLet ( ) : NodeLet
ParseMods ( ) : Modifiers
ParseParameter ( ) : Parameter
ParseParameterList ( ) : ParameterList

This expects the arguments to be surrounded by pipes.

ParsePrimaryExpr ( bool isEnclosed, bool doError = true ) : NodeExpr
ParseRet ( ) : NodeRet
ParseTy ( ) : Spanned
ParseTypeDef ( Modifiers mods ) : NodeTypeDef
Peek ( int offset ) : Token

Method Details

ParseTopLevel() public method

This can return any top level node, but should only like statements.
public ParseTopLevel ( ) : Node
return SyntaxTree.Node

ParserState() public method

public ParserState ( DetailLogger log, TokenList tokens, string fileName ) : System.Collections.Generic
log Log.DetailLogger
tokens Lex.TokenList
fileName string
return System.Collections.Generic