The lexer creates tokens (see TokenType and Token) from an input string. The input string is expected to be in infix notation form. The lexer can convert an infix stream into a postfix stream (Reverse Polish Notation) for further processing by a Parser.

Constructors

Lexer()

Creates a new lexer.

Properties

hashCode → int

Get a hash code for this object.

read-only, inherited
intBuffer → String

Buffer for numbers

read / write
keywords → Map

read-only
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited
varBuffer → String

Buffer for variable and function names

read / write

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
shuntingYard(List<Token> stream) → List<Token>

Transforms the lexer's token stream into RPN using the Shunting-yard algorithm. Returns a list of Token in RPN form. Throws an ArgumentError if the list is empty.

tokenize(String inputString) → List<Token>

Tokenizes a given input string. Returns a list of Token in infix notation.

tokenizeToRPN(String inputString) → List<Token>

This method invokes the createTokenStream methode to create an infix token stream and then invokes the shunting yard method to transform this stream into a RPN (reverse polish notation) token stream.

toString() → String

Returns a string representation of this object.

inherited