public class RuntimeData extends Object
| Modifier and Type | Field and Description |
|---|---|
int |
codeRule
ID of the automatically generated rules
|
int |
columnNumber
Current column in the source
|
List<RuleItem> |
currentRuleItems
Temporary space for rule items before assignment
|
String |
currentStringValue
The token's value
|
int |
lineNumber
Current source line number
|
int |
ruleActionCount
How many actions do I have?
|
| Constructor and Description |
|---|
RuntimeData()
Initialize the current runtime data
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRegularExpression(Dfa dfa)
Add a regular expression DFA
|
NonTerminal |
findNonTerminalById(int id)
Find one non terminal by id
|
NonTerminal |
findNonTerminalByName(String name)
Find one non terminal by name
|
NonTerminal |
findNonTerminalByToken(int tokenId)
Find one non terminal by token
|
<T extends Symbol> |
findSymbolById(List<T> table,
int id)
Generic routine to find symbols
|
<T extends Symbol> |
findSymbolByName(List<T> table,
String name)
Generic routine to find symbols
|
<T extends Symbol> |
findSymbolByToken(List<T> table,
int tokenId)
Generic routine to find symbols
|
Terminal |
findTerminalById(int id)
Find one terminal by id
|
Terminal |
findTerminalByName(String name)
Find one terminal by name
|
Terminal |
findTerminalByToken(int tokenId)
Find one terminal by token
|
Type |
findType(String name)
Locate a type
|
static RuntimeData |
getCurrentRuntimeData()
Get the global runtime data for this thread
|
List<TokenGroup> |
getErrorGroups() |
List<String> |
getErrorMessages() |
List<NonTerminal> |
getNonTerminals() |
int |
getNumberOfActions() |
int |
getNumberOfErrors() |
int |
getNumberOfGoTos() |
int |
getNumberOfRecoveries() |
List<Dfa> |
getRegularExpressions() |
NonTerminal |
getRoot() |
List<Rule> |
getRules() |
NonTerminal |
getStart() |
State[] |
getStates() |
List<Terminal> |
getTerminals() |
List<Type> |
getTypes() |
boolean |
hasFinalActions() |
boolean |
isStackTypeDefined() |
void |
setErrorMessages(List<String> errorMessages) |
void |
setFinalActions(boolean finalActions) |
void |
setNonTerminals(List<NonTerminal> nonTerminals) |
void |
setNumberOfActions(int numberOfActions) |
void |
setNumberOfErrors(int numberOfErrors) |
void |
setNumberOfGoTos(int numberOfGoTos) |
void |
setNumberOfRecoveries(int numberOfRecoveries) |
void |
setRegularExpressions(List<Dfa> regularExpressions) |
void |
setRoot(NonTerminal root) |
void |
setRules(List<Rule> rules) |
void |
setStackTypeDefined(boolean stackTypeDefined) |
void |
setStart(NonTerminal start) |
void |
setStates(State[] i) |
void |
setTerminals(List<Terminal> terminals) |
void |
setTypes(List<Type> types) |
boolean |
symbolCanBeEmpty(int nonTerminalId)
Check to see if a rule identified by nonTerminalId is empty, i.e.
|
public int codeRule
public int lineNumber
public int columnNumber
public String currentStringValue
public List<RuleItem> currentRuleItems
public int ruleActionCount
public static RuntimeData getCurrentRuntimeData()
public boolean symbolCanBeEmpty(int nonTerminalId)
nonTerminalId - is the id of the rule to checkpublic <T extends Symbol> T findSymbolByName(List<T> table, String name)
T - is the type of the symboltable - the table to look intoname - the name of the symbolpublic <T extends Symbol> T findSymbolByToken(List<T> table, int tokenId)
T - is the type of the symboltable - the table to look intotokenId - the token of the symbolpublic <T extends Symbol> T findSymbolById(List<T> table, int id)
T - is the type of the symboltable - the table to look intoid - the id of the symbolpublic Terminal findTerminalByName(String name)
name - the name of the symbolpublic Terminal findTerminalByToken(int tokenId)
tokenId - the token of the symbolpublic Terminal findTerminalById(int id)
id - the id of the symbolpublic NonTerminal findNonTerminalByName(String name)
name - the name of the symbolpublic NonTerminal findNonTerminalByToken(int tokenId)
tokenId - the token of the symbolpublic NonTerminal findNonTerminalById(int id)
id - the id of the symbolpublic Type findType(String name)
name - the name of the typepublic NonTerminal getRoot()
public void setRoot(NonTerminal root)
root - the root to setpublic NonTerminal getStart()
public void setStart(NonTerminal start)
start - the start to setpublic List<NonTerminal> getNonTerminals()
public void setNonTerminals(List<NonTerminal> nonTerminals)
nonTerminals - the nonTerminals to setpublic void setTerminals(List<Terminal> terminals)
terminals - the terminals to setpublic State[] getStates()
public void setStates(State[] i)
i - the i to setpublic int getNumberOfGoTos()
public void setNumberOfGoTos(int numberOfGoTos)
numberOfGoTos - the numberOfGoTos to setpublic int getNumberOfActions()
public void setNumberOfActions(int numberOfActions)
numberOfActions - the numberOfActions to setpublic int getNumberOfErrors()
public void setNumberOfErrors(int numberOfErrors)
numberOfErrors - the numberOfErrors to setpublic int getNumberOfRecoveries()
public void setNumberOfRecoveries(int numberOfRecoveries)
numberOfRecoveries - the numberOfRecoveries to setpublic void setErrorMessages(List<String> errorMessages)
errorMessages - the errorMessages to setpublic boolean hasFinalActions()
public void setFinalActions(boolean finalActions)
finalActions - the finalActions to setpublic boolean isStackTypeDefined()
public void setStackTypeDefined(boolean stackTypeDefined)
stackTypeDefined - the stackTypeDefined to setpublic List<TokenGroup> getErrorGroups()
public void setRegularExpressions(List<Dfa> regularExpressions)
regularExpressions - the regularExpressions to setpublic void addRegularExpression(Dfa dfa)
dfa - is the DFA to addCopyright © 2017. All rights reserved.