<private> new Actions(g)
Creates the singleton with the action methods.
Parameters:
| Name | Type | Description |
|---|---|---|
g |
module:EBNF~Grammar | to hold the rule representations. |
- Source:
Properties:
| Name | Type | Description |
|---|---|---|
g |
module:EBNF~Grammar | the grammar to add precedences and rules to. |
Methods
-
alt()
-
alt: seq [{ '|' seq }];Returns:
represents a list of one or more alternatives.
- Type
- module:EBNF~Alt
-
grammar()
-
grammar: [{ level }] { rule };Returns:
represents the grammar, not yet checked.
- Type
- module:EBNF~Grammar
-
level()
-
level: '%left' { term } ';' | '%right' { term } ';' | '%nonassoc' { term } ';';Returns:
represents a precedence level.
-
lit()
-
lit: Lit;Returns:
represents a used literal.
- Type
- module:EBNF~Lit
-
opt()
-
opt: '[' alt ']';Returns:
represents an optional list of one or more alternatives.
- Type
- module:EBNF~Opt
-
ref()
-
ref: Token;Returns:
represents a used token or a non-terminal.
- Type
- module:EBNF~Token | module:EBNF~NT
-
rule()
-
rule: Token ':' alt ';';Returns:
represents a rule.
- Type
- module:EBNF~Rule
-
seq()
-
seq: { lit | ref | opt | some } [ '%prec' term ];Returns:
represents a list of one or more items.
- Type
- module:EBNF~Seq
-
some()
-
some: '{' alt '}';Returns:
represents a list of one or more alternatives.
- Type
- module:EBNF~Some
-
term()
-
term: lit | ref;Returns:
represents a symbol.