new NT(name)
Creates a non-terminal symbol for BNF;
see factory method grammar.nt().
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | non-terminal's name. |
- Mixes In:
- Source:
Properties:
| Name | Type | Argument | Description |
|---|---|---|---|
rule |
module:EBNF~Rule |
<nullable> |
defines |
expect |
module:EBNF~Set | delegated to |
|
follow |
module:EBNF~Set |
<nullable> |
see |
name |
string | name for the non-terminal. |
Extends
Methods
-
deep()
-
Override getter: delegates to the referenced rule.
Returns:
the set, maps terminal names to true.
- Type
- module:EBNF~Set
-
dump()
-
Displays name and contents of all sets.
- Overrides:
- Source:
Returns:
- Type
- string
-
follow( [increment])
-
Override setter: sets
.ruleonly if it makes a difference; i.e., recursion stops here once there is no more change.Parameters:
Name Type Argument Description incrementmodule:EBNF~Set <optional>
<nullable>
controls getter/setter behavior, setter adds.
Returns:
the set, maps terminal names to true.
- Type
- module:EBNF~Set
-
parse(parser)
-
Delegates to the referenced rule..
Parameters:
Name Type Description parsermodule:EBNF~Parser context.
Throws:
-
if recognition fails.
- Type
- string
Returns:
the result produce by the referenced rule, see
parser.parse(). -
-
shallow( [increment])
-
Override getter: delegates to the referenced rule if any.
Parameters:
Name Type Argument Description incrementmodule:EBNF~Set <optional>
<nullable>
controls getter/setter behavior, setter adds.
Returns:
the (incremented) set, maps terminal names to true.
- Type
- module:EBNF~Set
-
toString()
-
Displays name of a non-terminal or
$accept.- Inherited From:
- Overrides:
- Source:
Returns:
- Type
- string