Class: NT

page.BNF. NT

Represents a (unique!) non-terminal for BNF.


<private> new NT(_name, _index)

Creates a new non-terminal representation for BNF.

Parameters:
Name Type Description
_name string

non-terminal's name.

_index number

non-terminal's index in page.BNF.nts.

Properties:
Name Type Description
name string

non-terminal's name.

index number

non-terminal's index in page.BNF.nts; transient, maintained by page.BNF#nt.

ord number

non-terminal's global index; transient, set in page.BNF#init.

rules Array.<page.BNF.Rule>

defining this; transient, maintained when a rule is constructed.

empty boolean

true if no input can be accepted.

reached boolean

true if this can be reached from rule zero, transient.

finite boolean

true if there is a non-recursive expansion, transient.

first Map

terminals at front, maps ord to page.BNF.T.

follow Map

terminals following, maps ord to page.BNF.T.

Source:

Methods


dump()

Displays index or ord and name and contents of all sets.

Source:
Returns:
Type
string

toString()

Displays name.

Source:
Returns:
Type
string