Lexer

Lexer

Lexical analyzer.

Analyze each lexeme from the given text in according to language alphabet/terminals/grammar.

Constructor

new Lexer(text) → {Lexer}

Source:

Lexer constructor.

Parameters:
Name Type Description
text string

plain text as code source

Returns:

instance of Lexer analyzer

Type
Lexer

Methods

tokenize() → {Array.<Token>}

Source:

Tokenize source code.

Analyze source text/code in according to language grammar and produce a structure of tokens.

Returns:

array of Token instances

Type
Array.<Token>