<private> new Actions(g)
Creates the singleton with the action methods.
Parameters:
| Name | Type | Description |
|---|---|---|
g |
module:BNF~Grammar | to hold the rule representations. |
- Source:
Properties:
| Name | Type | Description |
|---|---|---|
g |
module:BNF~Grammar | the grammar to add precedences and rules to. |
Methods
-
grammar()
-
grammar: precedences rules;Returns:
g - represents and checks the grammar.
- Type
- module:BNF~Grammar
-
lit()
-
lit: Lit;Returns:
represents a used literal.
- Type
- module:BNF~Lit
-
name()
-
name: Name;Returns:
represents a used token or a non-terminal.
- Type
- module:BNF~Token | module:BNF~NT
-
precedences()
-
precedences: ;
precedences: precedences '%left' terminals ';';
precedences: precedences '%right' terminals ';';
precedences: precedences '%nonassoc' terminals ';'; -
rule()
-
rule: Name ':' symbols ';';
rule: Name ':' symbols '%prec' terminal ';';Returns:
represents a rule.
- Type
- module:BNF~Rule
-
symbols()
-
symbols: ;
symbols: symbols name;
symbols: symbols lit;Returns:
represents a list of symbols.
- Type
- Array.<module:Base~Symbol>
-
terminal()
-
terminal: lit;
terminal: name;Returns:
represents a terminal.
- Type
- module:BNF~Lit | module:BNF~Token
-
terminals()
-
terminals: terminal;
terminals: terminals terminal;Returns:
represents a list of terminals.
- Type
- module:BNF~Lit | module:BNF~Token