ParseResult class

The result of parsing an input string.

Implemented types

Constructors

ParseResult(bool success, String remaining, {String? lexeme, String? ruleName, String? element, Stack<ParseResult>? stack})
Creates a ParseResult.

Properties

element String?
A string representation of the parsed grammar element.
final
hashCode int
The hash code for this object.
no setterinherited
lexeme String?
The matched string, or null if there was no match (e.g., failed or optional match).
final
remaining String
The unparsed suffix of the input string.
final
ruleName String?
The name of the rule that produced this result, if any.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stack Stack<ParseResult>
The hierarchical tree of child ParseResults produced during this parse.
final
success bool
Whether the parse was successful.
final

Methods

getRuleLexemes(String ruleName) List<String>
Computes all lexemes for a given rule name in the parse tree. Uses a visited set to protect against infinite recursion if the parse tree contains cycles.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
override
toString() String
A string representation of this object.
inherited

Operators

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