<private> new State(_configs, _core, _actions)
Creates a representation for a new state of the SLR(1) automaton.
Parameters:
| Name | Type | Description |
|---|---|---|
_configs |
Array.<page.SLR1.Config> | core and closure defining this state. |
_core |
number | number of marked rules in the core. |
_actions |
Map | maps possible next symbols to null. |
- Source:
Properties:
| Name | Type | Description |
|---|---|---|
configs |
Array.<page.SLR1.Config> | core and closure defining this state. |
core |
number | number of marked rules in the core. |
actions |
Map | maps possible next symbols to actions. |
Methods
-
advance(_factory, _stateNumber)
-
Creates and populates the state/symbol/action table. Fills in
reducefor complete configurations,shiftfor terminals,acceptfor the end of input terminal, andgotofor non-terminals. For conflict resolution see page.SLR1.Parameters:
Name Type Description _factorypage.SLR1 the keeper of the state table, factory for new states.
_stateNumbernumber this state's number.
- Source:
-
dump(_core)
-
Displays all configurations and actions.
Parameters:
Name Type Description _coreboolean if true, only displays core configurations.
- Source:
Returns:
- Type
- string
-
equals(_core)
-
Compares a core of marked rules to this state's core.
Parameters:
Name Type Description _coreArray.<page.SLR1.Config> to compare to this.
- Source:
Returns:
true if this state has the same core (in any order).
-
toString()
-
Displays core configurations and actions.
- Source:
Returns:
- Type
- string
page