|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.umlv.tatoo.runtime.parser.StateMetadata<T,N,P,V>
T - type of terminals.N - type of non-terminals.V - type of versions.P - public abstract class StateMetadata<T,N,P,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
ParserErrorRecoveryListener which terminal or non terminal value that must be pop
from the stack.
| Constructor Summary | |
|---|---|
StateMetadata(ReduceAction<T,P,V> defaultReduce)
|
|
| Method Summary | ||
|---|---|---|
static
|
createAllVersionWithNonTerminal(N nonTerminal,
ReduceAction<T,P,V> defaultReduce)
Creates a state data compatible with all versions that reduce a non terminal. |
|
static
|
createAllVersionWithTerminal(T terminal,
ReduceAction<T,P,V> defaultReduce)
Creates a state data compatible with all versions that shift a terminal. |
|
static
|
createWithNonTerminal(Set<?> compatible,
N nonTerminal,
ReduceAction<T,P,V> defaultReduce)
Creates a state data compatible with a set of versions that reduce a non terminal. |
|
static
|
createWithTerminal(Set<?> compatible,
T terminal,
ReduceAction<T,P,V> defaultReduce)
Creates a state data compatible with a set of versions that shift a terminal. |
|
ReduceAction<T,P,V> |
getDefaultReduce()
|
|
boolean |
isCompatible(V version)
Returns true if the state is compatible with the version taken as argument. |
|
abstract void |
popVariableOnError(ParserErrorRecoveryListener<? 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(ReduceAction<T,P,V> defaultReduce)
| Method Detail |
|---|
public boolean isCompatible(V version)
version - the version
public abstract void popVariableOnError(ParserErrorRecoveryListener<? super T,? super N> listener)
default error recovery
mechanism to adjust the stack of value used by the evaluator.
This implementation calls ParserErrorRecoveryListener.popNonTerminalOnError(Object)
if the current state is a reduce with a non terminal or
ParserErrorRecoveryListener.popTerminalOnError(Object) id the current state is
a shift with a terminal.
listener - the error recovery listenerpublic ReduceAction<T,P,V> getDefaultReduce()
public static <T,N,P,V> StateMetadata<T,N,P,V> createAllVersionWithTerminal(T terminal, ReduceAction<T,P,V> defaultReduce)
T - type of terminalN - type of non terminalV - type of versionterminal - the shifted terminal
public static <T,N,P,V> StateMetadata<T,N,P,V> createAllVersionWithNonTerminal(N nonTerminal, ReduceAction<T,P,V> defaultReduce)
T - type of terminalN - type of non terminalV - type of versionnonTerminal - the reduced non terminal
public static <T,N,P,V> StateMetadata<T,N,P,V> createWithTerminal(Set<?> compatible, T terminal, ReduceAction<T,P,V> defaultReduce)
T - type of terminalN - type of non terminalV - type of versioncompatible - a set of compatible versionsterminal - the shifted terminal
public static <T,N,P,V> StateMetadata<T,N,P,V> createWithNonTerminal(Set<?> compatible, N nonTerminal, ReduceAction<T,P,V> defaultReduce)
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 | |||||||||