Global

Type Definitions


Builder(_values, _env, _tuple, _sender)

Builder function implementing a semantic action for page.LL1#reflect and page.SLR1#reflect.

Parameters:
Name Type Description
_values Array.<object>

top-level value list, collected for this semantic action.

_env object

environment, originally connected to the observer.

_tuple page.Tuple

current input.

_sender object

of this message, e.g., page.LL1 or page.SLR1.

Source:
Throws:

a string with an error message to continue parsing or an Error with an error message to abort further parsing.

Type
string | Error
Returns:

a value which will be pushed, or concatenated by the observer.

Type
object | Array.<object>

eNode

Nodes in an EBNF grammar.

Type:
Source:

epNode

Nodes in an EBNFP grammar.

Type:
Source:

Map

Hashtable with strings or numbers as keys.

Type:
  • object
Source:
See:

Node

Nodes in a BNF grammar.

Type:
Source:

Observer(_at, _tuple, _action, _info, _sender)

The result of page.trace, page.LL1#reflect, or page.SLR1#reflect: a function which can observe a parser.

Parameters:
Name Type Description
_at number

where the parser is, e.g., a rule or state number.

_tuple page.Tuple

current input.

_action string

'rule', 'shift', or 'reduce' for LL(1), 'shift', 'reduce', 'goto', or 'accept' for SLR(1), or 'error'.

_info page.BNF.Rule | page.BNF.T | number | string

a reference to the relevant rule, terminal, or state number, or an error message.

_sender object

of this message, e.g., page.LL1 or page.SLR1.

Source:
Throws:

a string with an error message to continue parsing or an Error with an error message to abort further parsing.

Type
string | Error
Returns:

anything on success.

Type
object

Tokenizer(input)

The result of page.BNF#tokenizer

Parameters:
Name Type Description
input string

to be divided into literals and tokens.

Properties:
Name Type Description
pattern string

read-only, used to disect the input, combines all tokens, literals and the skip pattern.

Source:
Returns:

a list of literals and tokens.

Type
Array.<page.Tuple>