Class: NT

EBNF~ NT

Represents a non-terminal symbol for EBNF.


new NT(name)

Creates a non-terminal symbol for BNF; see factory method grammar.nt().

Parameters:
Name Type Description
name string

non-terminal's name.

Properties:
Name Type Argument Description
rule module:EBNF~Rule <nullable>

defines this, initially null.

expect module:EBNF~Set

delegated to .rule.

follow module:EBNF~Set <nullable>

see node.follow().

name string

name for the non-terminal.

Mixes In:
Source:

Extends

Methods


deep()

Override getter: delegates to the referenced rule.

Source:
See:
  • {linkcode module:EBNF~Node#deep Node.deep(increment)}.
Returns:

the set, maps terminal names to true.

Type
module:EBNF~Set

dump()

Displays name and contents of all sets.

Overrides:
Source:
Returns:
Type
string

follow( [increment])

Override setter: sets .rule only if it makes a difference; i.e., recursion stops here once there is no more change.

Parameters:
Name Type Argument Description
increment module:EBNF~Set <optional>
<nullable>

controls getter/setter behavior, setter adds.

Source:
See:
  • {linkcode module:EBNF~Node#follow Node.fallow(increment)}.
Returns:

the set, maps terminal names to true.

Type
module:EBNF~Set

parse(parser)

Delegates to the referenced rule..

Parameters:
Name Type Description
parser module:EBNF~Parser

context.

Source:
Throws:

if recognition fails.

Type
string
Returns:

the result produce by the referenced rule, see parser.parse().


shallow( [increment])

Override getter: delegates to the referenced rule if any.

Parameters:
Name Type Argument Description
increment module:EBNF~Set <optional>
<nullable>

controls getter/setter behavior, setter adds.

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 name of a non-terminal or $accept.

Inherited From:
Overrides:
Source:
Returns:
Type
string