public class NonTerminal extends Symbol
-+Symbol| +--+Terminal- Lexical Symbol (i.e. number, id '+') | | | +--ErrorToken- Lexical Symbol declared with %error | +-- NonTerminal - Syntactical symbol (i.e. Expression, Statement)
associativity, count, fullName, id, name, precedence, token, type, variable| Constructor and Description |
|---|
NonTerminal(String name)
Construct one non terminal
|
| Modifier and Type | Method and Description |
|---|---|
void |
addGoTo(GoTo goThere)
Add a goto to the goto set
|
void |
appendGoto(int origin,
int destination)
Create a goto, and then add it to the goto list
|
int |
getDefaultGoto()
compute the default goto for a non-terminal.
|
Set<Integer> |
getFirst() |
Set<Integer> |
getFollow() |
List<GoTo> |
getGotos() |
boolean |
isCodeFragment() |
int |
removeGotos(int destinationState)
Remove the gotos identified by the destination
|
void |
setCodeFragment(boolean codeFragment) |
void |
setFirst(Set<Integer> first) |
void |
setFollow(Set<Integer> follow) |
computeVariable, equals, getAssociativity, getCount, getFullName, getId, getName, getPrecedence, getToken, getType, getVariable, isIdentifier, setAssociativity, setCount, setFullName, setId, setName, setPrecedence, setToken, setType, toStringpublic NonTerminal(String name)
name - is the name of the non terminalpublic void appendGoto(int origin,
int destination)
origin - the origin statedestination - the destination state.public int getDefaultGoto()
public int removeGotos(int destinationState)
destinationState - is the destination statepublic void addGoTo(GoTo goThere)
goThere - the go to descriptorpublic boolean isCodeFragment()
public void setCodeFragment(boolean codeFragment)
codeFragment - is the flag indicating that this non terminal
is a code fragment.Copyright © 2017. All rights reserved.