Parser class
The Parser creates a mathematical Expression from a given input string.
It uses a Lexer to create a RPN token stream and then builds the expression.
Usage example:
Parser p = Parser();
Expression exp = p.parse("(x^2 + cos(y)) / 3");
Constructors
- Parser()
- Creates a new parser.
Properties
-
functionHandlers
↔ Map<
String, dynamic> -
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- lex → Lexer
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addFunction(
String name, dynamic handler) → void - Registers a function handler with the parser.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parse(
String inputString) → Expression -
Parses the given input string into an Expression. Throws a
ArgumentError if the given
inputString
is empty. Throws a StateError if the token stream is invalid. Returns a valid Expression. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited