Parser class

Constructors

Parser(List<Token> tokens)

Properties

curr int
getter/setter pair
errors List<String>
final
hashCode int
The hash code for this object.
no setterinherited
loopDepth int
If loopDepth > 0 we are in a loop construct and can break. This is used to detect the correctness of the "break" keyword.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tokens List<Token>
final
warns List<String>
final

Methods

addError(String err) → void
addWarning(String warn) → void
advance() Token
advanceAndThen<T>(T then()) → T
analyze() AST
anyOf(List<TokenType> types) bool
argList({TokenType? terminal, List<TokenType>? terminals}) List<MathExpr>
assignStmt(Stmt lhs) AssignStmt
binaryExpr() MathExpr
bitwiseExpr() MathExpr
bodyStmt({TokenType? terminal, List<TokenType>? terminals}) List<Stmt>
breakStmt() Stmt
canMultAssignWith(Stmt term) bool
compareExpr() MathExpr
consume(TokenType expected, String err) Token
declFuncExpr() FuncExpr
declMultiVarStmt({required bool local}) Stmt
doBlockStmt() DoBlockStmt
eof() bool
factorExpr() MathExpr
falseExpr() MathExpr
forLoopStmt() Stmt
gotoLabelStmt() Stmt
gotoStmt() Stmt
groupExpr() MathExpr
ifStmt() IfStmt
ifStmtBranch(Token token) IfStmt
literal() MathExpr
localStmt() Stmt
logicalAndExpr() MathExpr
logicalOrExpr() MathExpr
math() MathExpr
Older code used to be here. Now "math" just starts descent starting from "logicalOrExpr".
memoryExpr() MathExpr
multiAssignStmt({required Stmt first}) Stmt
Assignments cannot be used as math expressions. Therefore this function returns Stmt type.
nilLiteral() MathExpr
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notExpr() MathExpr
numberLiteral() MathExpr
objectExpr() MathExpr
peek({int? offset}) Token
rawExpr() RawExpr
repeatUntilLoopStmt() Stmt
returnStmt() Stmt
selfExpr() MathExpr
stmt() Stmt?
stringLiteral() MathExpr
tableExpr() MathExpr
tablePairExpr() KeyValStmt
tablePairsList() List<KeyValStmt>
toString() String
A string representation of this object.
inherited
trueExpr() MathExpr
unaryExpr() MathExpr
whileLoopStmt() Stmt

Operators

operator ==(Object other) bool
The equality operator.
inherited