|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--comp.Node | +--comp.VarDecl
Represents a variable declaration. A variable decalaration is a type and a list of names that are of that type. Optionally, it may also have an initializer.
Field Summary | |
(package private) AssignNode |
initializer
|
(package private) boolean |
isExtern
|
(package private) java.util.List |
names
|
(package private) Type |
type
|
(package private) java.lang.String |
typeName
|
Fields inherited from class comp.Node |
asm, globalScope, labelCount, strings |
Constructor Summary | |
(package private) |
VarDecl(java.lang.String name)
A new variable declaration of indeterminate type. |
(package private) |
VarDecl(java.lang.String typeName,
java.lang.String name)
A variable declaration of given type and name. |
(package private) |
VarDecl(java.lang.String typeName,
java.lang.String name,
ExprNode init)
A variable declaration with the given initializer expression. |
(package private) |
VarDecl(java.lang.String typeName,
java.lang.String name,
int length)
An array variable declaration . |
Method Summary | |
void |
add(java.lang.String id)
Add another name to the list. |
void |
addDefs(Scope s)
Add any variable definitions made by this node to the given scope. |
void |
asHTML(java.io.PrintStream out)
Process this node. |
java.lang.String |
codeGen(Scope scope,
RegBank bank)
Generally do nothing, unless I have an initializer. |
void |
dumpAsGlobal()
Dump global as global text. |
void |
initWith(ExprNode e)
Set the initializer expression. |
void |
setType(java.lang.String typeName)
Set the type. |
java.lang.String |
toString()
|
Methods inherited from class comp.Node |
addString, getLabel, lvalue, reset, rvalue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
java.util.List names
java.lang.String typeName
Type type
AssignNode initializer
boolean isExtern
Constructor Detail |
VarDecl(java.lang.String name)
VarDecl(java.lang.String typeName, java.lang.String name)
VarDecl(java.lang.String typeName, java.lang.String name, int length)
VarDecl(java.lang.String typeName, java.lang.String name, ExprNode init)
Method Detail |
public java.lang.String toString()
toString
in class java.lang.Object
public void initWith(ExprNode e)
public void setType(java.lang.String typeName)
public void add(java.lang.String id)
public java.lang.String codeGen(Scope scope, RegBank bank)
codeGen
in class Node
public void addDefs(Scope s)
Node
addDefs
in class Node
public void dumpAsGlobal()
public void asHTML(java.io.PrintStream out)
asHTML
in class Node
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |