Lexer

Package: Libraries.Language.Compile.Parsing · Inherits from: Libraries.Language.Object

This is a general purpose class for defining lexers in Quorum. Subclasses implement the interface how they see fit for particular languages.

Actions

Add(Libraries.Language.Compile.Parsing.Token token)

Parameters

Empty()

This action empties the list of tokens.

GetIterator()

This action returns an iterator over the tokens. We can use this to automatically iterate over non-documentation tokens, to do lookahead and look back, and other operations that are harder to manage through the raw Get action.

Returns

Libraries.Language.Compile.Parsing.TokenIterator<Libraries.Language.Compile.Parsing.Token>: TokenIterator

GetSize()

This action returns the number of tokens in the token stream.

Returns

integer: The number of tokens in the stream.

GetToken(integer i)

This method returns a token at a particular position in the lex.

Parameters

  • i integer: The index of the token to get

Returns

Libraries.Language.Compile.Parsing.Token

IsEmpty()

This action Returns whether or not there are tokens in the token stream

Returns

boolean: a boolean value to indicate if the stream is empty.

Read(Libraries.System.File file)

This action is used to read a text file and converts it into a token stream.

Parameters

Read(text value)

This action is used to read a text value and converts it into a token stream. Subclasses for particular languages define how they read and manage errors.

Parameters

  • value text: The text value to lex.

Inherited Actions

3 actions from Libraries.Language.Object