<private> new Rule(_nt, _symbols)
Creates a new BNF rule.
Parameters:
Name | Type | Description |
---|---|---|
_nt |
page.BNF.NT | left-hand side, non-terminal. |
_symbols |
Array.<Node> | right-hand side. |
- Source:
- See:
Properties:
Name | Type | Description |
---|---|---|
nt |
page.BNF.NT | rule's non-terminal (left-hand side). |
symbols |
Array.<Node> | rule's right-hand side. |
index |
number | rule's index in page.BNF |
empty |
boolean | true if no input can be accepted. |
reached |
boolean |
|
finite |
boolean |
|
first |
Map | terminals at front, maps ord to page.BNF.T. |
Methods
-
dump()
-
Displays index, rule,
empty
, and content offirst
.- Source:
Returns:
- Type
- string
-
toString( [_mark])
-
Displays a rule in BNF notation.
Parameters:
Name Type Argument Description _mark
number <optional>
precedes a symbol on the right-hand side if it is in range.
- Source:
Returns:
- Type
- string