<private> new Seq(_nodes [, _prec])
Creates a new representation of a sequence with optional precedence for EBNFP.
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
_nodes |
Array.<epNode> | sequence, at least two, or with precedence. |
|
_prec |
page.BNF.T |
<optional> |
terminal providing the precedence. |
- Source:
Properties:
| Name | Type | Argument | Description |
|---|---|---|---|
nodes |
Array.<epNode> | descendants, at least two, or with precedence. |
|
prec.t |
page.BNF.T |
<optional> |
terminal providing the precedence. |
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
alt: a b %prec 'x' | c %prec 'y';
Extends
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.followfrom page.EBNF.Seq.ntand then delegates to the descendants.- Inherited From:
- Source:
-
<private> toBNF(_grammar [, _nt])
-
Parameters:
Name Type Argument Description _grammarpage.EBNF object to which the construct belongs.
_ntpage.EBNF.NT <optional>
left-hand side, if known; avoids the need for a fresh non-terminal.
- Inherited From:
- Source:
Returns:
non-terminal representing the translated construct.
- Type
- page.BNF.NT
-
<private> toBNF(_grammar [, _nt])
-
Called once by page.EBNFP#init to recursively translate into BNF.
a %prec bis translated to
$#: a %prec b;Parameters:
Name Type Argument Description _grammarpage.EBNFP object to which the construct belongs.
_ntpage.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 a sequence in EBNF notation.
- Inherited From:
- Source:
Returns:
.
- Type
- string
-
toString()
-
Displays a sequence in EBNF notation with precedence, if any.
- Source:
Returns:
.
- Type
- string
page