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) |
Classes
Type Definitions
-
Action(value)
-
Method to process values collected by a rule.
Parameters:
Name Type Argument Description valueObject <repeatable>
one value collected per item on the right-hand side.
Throws:
-
a string with an error message to continue recognition or an
Errorwith 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
-