|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.umlv.tatoo.runtime.parser.ParserTable<T,N,P,V>
T - type of terminal.N - type of non-terminal.P - type of production.V - type of version.public class ParserTable<T,N,P,V>
Action table associated with a grammar. This table is created using the generated informations by Tatoo parser.
| Constructor Summary | |
|---|---|
ParserTable(Map<T,Action<T,P,V>[]> table,
Action<T,P,V>[] branchArray,
StateMetadata<T,N,P,V>[] stateMetadata,
Map<N,Integer> startMap,
V[] versions,
int stateNb,
T eof,
T error)
Creates a parser table. |
|
| Method Summary | |
|---|---|
Action<T,P,V>[] |
getActions(T terminal)
Returns the actions (shift/reduce/accept/error) associated with a particular terminal of the grammar. |
Action<T,P,V>[] |
getBranchArray()
|
N |
getDefaultStart()
Returns the default start non terminal. |
V |
getDefaultVersion()
Returns the default version. |
T |
getEof()
Returns the terminal indicating the end of file (eof). |
T |
getErrorTerminal()
Returns the error terminal. |
StateMetadata<T,N,P,V> |
getMetadataForState(int state)
Returns meta-data for error recovery associated with a particular state number. |
Map<N,Integer> |
getStartMap()
Returns the table filled by Tatoo that associates the index of the initial state with a peculiar start non-terminal. |
int |
getStateNb()
Returns the number of states in the table. |
Map<T,Action<T,P,V>[]> |
getTable()
Returns the table filled by Tatoo that associates action (shift/reduce/accept/error) with each terminal of the grammar. |
List<V> |
getVersions()
Returns the list containing all versions of the grammar. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ParserTable(Map<T,Action<T,P,V>[]> table,
Action<T,P,V>[] branchArray,
StateMetadata<T,N,P,V>[] stateMetadata,
Map<N,Integer> startMap,
V[] versions,
int stateNb,
T eof,
T error)
table - a table that map action or versioned action to a terminal
for a specific state index.branchArray - an array that contains an action
for a specific state index used by branching parser.stateMetadata - the metadata associated to the state,
see getMetadataForState(int).startMap - a map that associates start non terminal to their state
index in the table.versions - all declared versions of the grammar.stateNb - the number of states.eof - the terminal eof.error - the terminal error used by the
default error recovery mecanism.| Method Detail |
|---|
public Action<T,P,V>[] getActions(T terminal)
terminal - the terminal.
public int getStateNb()
public Map<T,Action<T,P,V>[]> getTable()
public Action<T,P,V>[] getBranchArray()
public T getEof()
public T getErrorTerminal()
DefaultParserErrorRecoveryPolicypublic StateMetadata<T,N,P,V> getMetadataForState(int state)
state - the state number.
public Map<N,Integer> getStartMap()
public N getDefaultStart()
public List<V> getVersions()
public V getDefaultVersion()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||