|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.adamcornett.cminus.Symbol
public class Symbol
| Field Summary | |
|---|---|
private int |
arraySize
If this symbol is an array, this represents how many elements are in the array. |
private org.antlr.runtime.Token |
ID
The Identifier token |
private boolean |
isArray
TRUE if this symbol is an array. |
private TokenLocation |
loc
The location of the symbol definition. |
private String |
name
The name of the token. |
private static int |
nextStackLocation
|
private Type |
type
The type of this symbol |
private List<TokenLocation> |
uses
The locations of the uses of this symbol. |
private int |
varLocation
The location of this variable in the local variable table. |
| Constructor Summary | |
|---|---|
Symbol(CMinusParser.type_specifier_return t,
org.antlr.runtime.Token token)
The non-array constructor |
|
Symbol(CMinusParser.type_specifier_return t,
org.antlr.runtime.Token token,
org.antlr.runtime.Token size)
The array constructor |
|
Symbol(Type ty,
org.antlr.runtime.Token token)
|
|
| Method Summary | |
|---|---|
void |
addUse(TokenLocation tl)
Add a usage of a symbol |
int |
compareTo(Symbol o)
|
boolean |
equals(Object obj)
|
int |
getArraySize()
|
TokenLocation |
getLocation()
Get the location of the definition of this symbol. |
String |
getName()
|
Type |
getType()
|
int |
getVarLocation()
|
boolean |
isArray()
|
static void |
resetStackLocation()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static int nextStackLocation
private int arraySize
private final org.antlr.runtime.Token ID
private final boolean isArray
TRUE if this symbol is an array.
private final TokenLocation loc
private final String name
private final int varLocation
private final Type type
private final List<TokenLocation> uses
| Constructor Detail |
|---|
public Symbol(CMinusParser.type_specifier_return t,
org.antlr.runtime.Token token)
t - The type of the symboltoken - The identifier for this token
public Symbol(CMinusParser.type_specifier_return t,
org.antlr.runtime.Token token,
org.antlr.runtime.Token size)
t - The array typetoken - The array namesize - The size of the array.
public Symbol(Type ty,
org.antlr.runtime.Token token)
| Method Detail |
|---|
public int getArraySize()
public static void resetStackLocation()
public void addUse(TokenLocation tl)
tl - The location of the symbolpublic int compareTo(Symbol o)
compareTo in interface Comparable<Symbol>public boolean equals(Object obj)
equals in class Objectpublic TokenLocation getLocation()
public String getName()
public int getVarLocation()
public Type getType()
public String toString()
toString in class Objectpublic boolean isArray()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||