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. |
- Source:
Properties:
| Name | Type | Description |
|---|---|---|
assert |
function | bound to |
mark |
function | bound to |
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. |
Methods
-
advance()
-
Advances the mark.
Returns:
a new configuration with the mark moved right, i.e.,
positionincreased by 1.- Type
- module:BNF~Mark
-
equals(c)
-
Compares two marks.
Parameters:
Name Type Description cmodule:BNF~Mark to compare to
this.Returns:
true if same rule and same position.
-
toString()
-
Displays the marked rule.
Returns:
- Type
- string