<private> new Rule(_nt, _symbol)
Creates a new EBNF rule.
Sets rule's non-terminal's page.EBNF.NT.rules
.
Parameters:
Name | Type | Description |
---|---|---|
_nt |
page.EBNF.NT | left-hand side, non-terminal. |
_symbol |
eNode | right-hand side. |
- Source:
Properties:
Name | Type | Description |
---|---|---|
nt |
page.EBNF.NT | rule's non-terminal (left-hand side). |
symbol |
eNode | rule's right-hand side. |
index |
number | rule's index in page.EBNF |
empty |
boolean | true if no input can be accepted. |
first |
Map | terminals at front, maps ord to page.BNF.T. |
follow |
Map | terminals following, maps ord to page.BNF.T. |
Extends
Methods
-
dump()
-
Displays index, rule,
empty
, and content offirst
.- Inherited From:
- Source:
Returns:
- Type
- string
-
dump()
-
Displays index, rule,
empty
, and contents offirst
andfollow
.- Source:
Returns:
- Type
- string
-
<private> init()
-
Called once by page.EBNF#init to complete EBNF grammar initialization. Imports page.BNF.NT
.empty
, page.BNF.NT.first
, and page.BNF.NT.follow
from.nt
. Delegates to.symbol
.- Source:
-
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.
- Inherited From:
- Source:
Returns:
- Type
- string
-
toString()
-
Displays a rule in EBNF notation.
- Source:
Returns:
- Type
- string