Class: Rule

page.BNFP. Rule

Represents a BNFP rule.


<private> new Rule(_nt, _symbols [, _prec])

Creates a new BNFP rule.

Parameters:
Name Type Argument Description
_nt page.BNF.NT

left-hand side, non-terminal.

_symbols Array.<Node>

right-hand side.

_prec Object | boolean <optional>

precedence or false.

Properties:
Name Type Description
prec Object | boolean

precedence or false.

Properties
Name Type Description
level number

precedence level, from 0.

assoc string

associativity, 'left', 'right' or 'nonassoc'.

t page.BNF.T

terminal providing the precedence.

explicit boolean

true if the precedence was explicitly assigned.

Source:

Extends

Methods


dump()

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

Inherited From:
Source:
Returns:
Type
string

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( [_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.

Source:
Returns:
Type
string