Module: Base

A module which contains classes and methods shared by both, the BNF and EBNF modules. It implements messaging, creating precedence levels, and creating scanners.

class main properties main methods
Factory config, errors,
lits[ByName], tokens[ByName], nts[ByName],
levels: Array<Precedence>
add(item), dump(item),
assert(condition, ...),
error(...),
message(...)
Precedence assoc, terminals
Scanner pattern scan(input): Array<Tuple>
Tuple lineno, t, value escape(s)
Version:
  • 2024-02-13
Author:
Source:

Classes

Factory
Lit
NT
Parser
Precedence
Scanner
Symbol
T
Token
Tuple

Type Definitions


Action(value)

Method to process values collected by a rule.

Parameters:
Name Type Argument Description
value Object <repeatable>

one value collected per item on the right-hand side.

Source:
Throws:

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

Type
string | Error
Returns:

the value to be collected in the parent rule or returned by recognition.

Type
Object