<private> new Lst(_node, _delim, _min)
Creates a new representation of a delimited iteration for EBNF.
Parameters:
Name | Type | Description |
---|---|---|
_node |
eNode | body; null if called during unmarshalling. |
_delim |
eNode | delimiter; null if called during unmarshalling. |
_min |
number | minimum number of occurences, 0 or 1. |
- Source:
Properties:
Name | Type | Description |
---|---|---|
node |
eNode | body. |
delim |
eNode | delimiter. |
min |
number | minimum number of occurences, 0 or 1. |
nt |
page.BNF.NT | corresponding non-terminal for BNF. |
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. |
Example
some: item +/ delimiter; many: item ⭑/ delimiter;
Methods
-
<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 page.EBNF.Lst#nt and then delegates to the descendants.- Source:
-
<private> toBNF(_grammar [, _nt])
-
Called once by page.EBNF#init to recursively translate into BNF.
a +/ b a ⭑/ b
where
.min
is 1 or 0, respectively, are translated to$#: ; # for min == 0 $#: a $##; # factored out $##: ; $##: b a $##;
Parameters:
Name Type Argument Description _grammar
page.EBNF object to which the construct belongs.
_nt
page.EBNF.NT <optional>
left-hand side, if known; avoids the need for a fresh non-terminal.
- Source:
Returns:
non-terminal representing the translated construct.
- Type
- page.BNF.NT
-
toString()
-
Displays delimited iteration in EBNF notation.
- Source:
Returns:
- Type
- string