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 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:
- page.BNF.Lit | page.BNF.Token | page.EBNF.Alt | page.EBNF.Lst | page.EBNF.NT | page.EBNF.Rep | page.EBNF.Seq
- Source:
-
epNode
-
Nodes in an EBNFP grammar.
Type:
- page.BNF.Lit | page.BNF.Token | page.EBNF.Alt | page.EBNFP.Lst | page.EBNF.NT | page.EBNFP.Rep | page.EBNFP.Seq
- 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 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.
- Source:
Properties:
Name Type Description pattern
string read-only, used to disect the input, combines all tokens, literals and the
skip
pattern.Returns:
a list of literals and tokens.
- Type
- Array.<page.Tuple>