Class: Mark

BNF~ Mark

Represents a mark in a rule.


new Mark(grammar, rule, position)

Creates a new mark for a rule; see factory method grammar.mark().

Parameters:
Name Type Description
grammar module:BNF~Grammar

supplies factory method.

rule module:BNF~Rule

rule to mark.

position number

position in rule, before a symbol or after all.

Properties:
Name Type Description
assert function

bound to grammar.assert().

mark function

bound to grammar.mark().

rule module:BNF~Rule

rule to mark.

position number

position in rule, before a symbol or after all.

complete boolean

true if position is after all symbols.

Source:

Methods


advance()

Advances the mark.

Source:
Returns:

a new configuration with the mark moved right, i.e., position increased by 1.

Type
module:BNF~Mark

equals(c)

Compares two marks.

Parameters:
Name Type Description
c module:BNF~Mark

to compare to this.

Source:
Returns:

true if same rule and same position.


toString()

Displays the marked rule.

Source:
Returns:
Type
string