Class: NT

BNF~ NT

Represents a non-terminal symbol for BNF.


new NT(name, index)

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

Parameters:
Name Type Description
name string

non-terminal's name.

index number

non-terminal's index in .nts.

Properties:
Name Type Description
index number

non-terminal's index in .nts.

ord number

non-terminal's global index; set in check().

rules Array.<module:BNF~Rule>

defining this.

empty boolean

true if no input can be accepted.

reached boolean

true if this can be reached from rule zero.

finite boolean

true if there is a non-recursive expansion.

first Object.<number, module:BNF~T>

terminals at front, maps ord to module:BNF~T.

follow Object.<number, module:BNF~T>

terminals following, maps ord to module:BNF~T.

name string

name for the non-terminal. Empty string is reserved for $accept, can be left-hand side of a start rule.

Source:

Extends

Methods


dump()

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

Overrides:
Source:
Returns:
Type
string

toString()

Displays name of a non-terminal or $accept.

Inherited From:
Overrides:
Source:
Returns:
Type
string