Class: Rule

page.EBNF. Rule

Represents an EBNF rule.


<private> new Rule(_nt, _symbol)

Creates a new EBNF rule. Sets rule's non-terminal's page.EBNF.NT.rules.

Parameters:
Name Type Description
_nt page.EBNF.NT

left-hand side, non-terminal.

_symbol eNode

right-hand side.

Properties:
Name Type Description
nt page.EBNF.NT

rule's non-terminal (left-hand side).

symbol eNode

rule's right-hand side.

index number

rule's index in page.EBNF.rules.

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.

Source:

Extends

Methods


dump()

Displays index, rule, empty, and content of first.

Inherited From:
Source:
Returns:
Type
string

dump()

Displays index, rule, empty, and contents of first and follow.

Source:
Returns:
Type
string

<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.follow from .nt. Delegates to .symbol.

Source:

toString( [_mark])

Displays a rule in BNF notation.

Parameters:
Name Type Argument Description
_mark number <optional>

precedes a symbol on the right-hand side if it is in range.

Inherited From:
Source:
Returns:
Type
string

toString()

Displays a rule in EBNF notation.

Source:
Returns:
Type
string