new Some(seqs)
Creates a repeatable list of alternatives;
see some() factory method.
Parameters:
| Name | Type | Description |
|---|---|---|
seqs |
Array.<module:EBNF~Seq> | the alternatives. |
- Source:
Properties:
| Name | Type | Argument | Description |
|---|---|---|---|
seqs |
Array.<module:EBNF~Seq> | the alternatives. |
|
expect |
module:EBNF~Set | set of terminals which a node
expects to see as |
|
follow |
module:EBNF~Set |
<nullable> |
see |
Extends
Methods
-
check(error, name)
-
Check for ambiguity:
expectandfollowmust be disjoint; delegate to superclass.Parameters:
Name Type Description errorfunction should be bound to
grammar.error().namestring current rule.
- Overrides:
- Source:
Returns:
error message, if any.
- Type
- undefined | string
-
deep()
-
Override getter: computes the set as sum over all descendants.
- Inherited From:
- Overrides:
- Source:
- See:
-
- {linkcode module:EBNF~Node#deep Node.deep(increment)}.
Returns:
the set, maps terminal names to true.
- Type
- module:EBNF~Set
-
follow( [increment])
-
Override setter: sets me, and sets descendants to my
.expectplusincrement.Parameters:
Name Type Argument Description incrementmodule:EBNF~Set <optional>
<nullable>
controls getter/setter behavior, setter adds.
- Overrides:
- Source:
- See:
-
- {linkcode module:EBNF~Node#follow Node.fallow(increment)}.
Returns:
the set, maps terminal names to true.
- Type
- module:EBNF~Set
-
parse(parser)
-
Recognizes the descendants one or more times.
Parameters:
Name Type Description parsermodule:EBNF~Parser context.
- Overrides:
- Source:
Throws:
-
if recognition fails.
- Type
- string
Returns:
list of at least one list created by a descendant
Alt, seeparser.parse(). The descendants are- Type
- Array.<Array>
-
shallow( [increment])
-
Override getter: computes the set as sum over all descendants.
Parameters:
Name Type Argument Description incrementmodule:EBNF~Set <optional>
<nullable>
controls getter/setter behavior, setter adds.
- Inherited From:
- Overrides:
- Source:
- See:
-
- {linkcode module:EBNF~Node#shallow Node.shallow(increment)}.
Returns:
the (incremented) set, maps terminal names to true.
- Type
- module:EBNF~Set
-
toString()
-
Displays a alternatives in braces.
- Overrides:
- Source:
Returns:
- Type
- string