Parser class

Constructors

Parser()

Properties

errorContext String
name of file, etc., used for error reporting
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
output ParseState?
Handy reference to the top of outputStack.
getter/setter pair
outputStack List<ParseState?>?
List of open code blocks we're working on (while compiling a function, we push a new one onto this stack, compile to that, and then pop it off when we reach the end of the function).
getter/setter pair
partialInput String?
Partial input, in the case where line continuation has been used.
getter/setter pair
pendingState ParseState?
A new parse state that needs to be pushed onto the stack, as soon as we finish with the current line we're working on:
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createImport() VFunction
Create a Function with the code we have parsed, for use as an import. That means, it runs all that code, then at the end it returns locals so that the caller can get its symbols.
createVM([TextOutputMethod? standardOutput]) Machine
Create a virtual machine loaded with the code we have parsed.
needMoreInput() bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(String sourceCode, {bool replMode = false}) → void
partialReset() → void
Partially reset, abandoning backpatches, but keeping already- compiled code. This would be used in a REPL, when the user may want to reset and continue after a botched loop or function.
repl(String line) → void
reset() → void
Completely clear out and reset our parse state, throwing out any code and intermediate results.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

endsWithLineContinuation(String sourceCode) bool
Return whether the given source code ends in a token that signifies that the statement continues on the next line. That includes binary operators, open brackets or parentheses, etc.
runUnitTests() → void
testValidParse(String src, {bool dumpTac = false}) → void