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 = new Parser();
Expression exp = p.parse("(x^2 + cos(y)) / 3");

Constructors

Parser()

Creates a new parser.

Properties

hashCode → int

Get a hash code for this object.

read-only, inherited
lex Lexer

read-only
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

noSuchMethod(Invocation invocation) → dynamic

noSuchMethod is invoked when users invoke a non-existent method on an object. The name of the method and the arguments of the invocation are passed to noSuchMethod in an Invocation. If noSuchMethod returns a value, that value becomes the result of the original invocation.

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

Returns a string representation of this object.

inherited