new NT(name, index)
Creates a non-terminal symbol for BNF;
see factory method grammar.nt().
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | non-terminal's name. |
index |
number | non-terminal's index in |
- Source:
Properties:
| Name | Type | Description |
|---|---|---|
index |
number | non-terminal's index in |
ord |
number | non-terminal's global index;
set in |
rules |
Array.<module:BNF~Rule> | defining |
empty |
boolean | true if no input can be accepted. |
reached |
boolean | true if this can be reached from rule zero. |
finite |
boolean | true if there is a non-recursive expansion. |
first |
Object.<number, module:BNF~T> | terminals at front, maps ord to module:BNF~T. |
follow |
Object.<number, module:BNF~T> | terminals following, maps ord to module:BNF~T. |
name |
string | name for the non-terminal.
Empty string is reserved for |
Extends
Methods
-
dump()
-
Displays index or ord and name and contents of all sets.
- Overrides:
- Source:
Returns:
- Type
- string
-
toString()
-
Displays name of a non-terminal or
$accept.- Inherited From:
- Overrides:
- Source:
Returns:
- Type
- string