|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.umlv.tatoo.runtime.parser.StateMetadata<T,N,V>
T
- type of terminals.N
- type of non-terminals.V
- type of versions.public abstract class StateMetadata<T,N,V>
Data associated to a state of the parsing table. This class contains basically to kind of state :
Parser.reset(Object)
or Parser.setVersion(Object)
.
default error recovery
mechanism if a state must be dropped to recover on error to signal to the
ErrorRecoveryListener
which terminal or non terminal value that must be pop
from the stack.
Constructor Summary | |
---|---|
StateMetadata()
|
Method Summary | ||
---|---|---|
static
|
createAllVersionWithNonTerminal(N nonTerminal)
Creates a state data compatible with all versions that reduce a non terminal. |
|
static
|
createAllVersionWithTerminal(T terminal)
Creates a state data compatible with all versions that shift a terminal. |
|
static
|
createWithNonTerminal(Set<?> compatible,
N nonTerminal)
Creates a state data compatible with a set of versions that reduce a non terminal. |
|
static
|
createWithTerminal(Set<?> compatible,
T terminal)
Creates a state data compatible with a set of versions that shift a terminal. |
|
boolean |
isCompatible(V version)
Returns true if the state is compatible with the version taken as argument. |
|
abstract void |
popVariableOnError(ErrorRecoveryListener<? super T,? super N> listener)
Called by the default error recovery
mechanism to adjust the stack of value used by the evaluator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StateMetadata()
Method Detail |
---|
public boolean isCompatible(V version)
version
- the version
public abstract void popVariableOnError(ErrorRecoveryListener<? super T,? super N> listener)
default error recovery
mechanism to adjust the stack of value used by the evaluator.
This implementation calls ErrorRecoveryListener.popNonTerminalOnError(Object)
if the current state is a reduce with a non terminal or
ErrorRecoveryListener.popTerminalOnError(Object)
id the current state is
a shift with a terminal.
listener
- the error recovery listenerpublic static <T,N,V> StateMetadata<T,N,V> createAllVersionWithTerminal(T terminal)
T
- type of terminalN
- type of non terminalV
- type of versionterminal
- the shifted terminal
public static <T,N,V> StateMetadata<T,N,V> createAllVersionWithNonTerminal(N nonTerminal)
T
- type of terminalN
- type of non terminalV
- type of versionnonTerminal
- the reduced non terminal
public static <T,N,V> StateMetadata<T,N,V> createWithTerminal(Set<?> compatible, T terminal)
T
- type of terminalN
- type of non terminalV
- type of versioncompatible
- a set of compatible versionsterminal
- the shifted terminal
public static <T,N,V> StateMetadata<T,N,V> createWithNonTerminal(Set<?> compatible, N nonTerminal)
T
- type of terminalN
- type of non terminalV
- type of versioncompatible
- a set of compatible versionsnonTerminal
- the reduced non terminal
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |