comp
Class IdNode
java.lang.Object
|
+--comp.Node
|
+--comp.ExprNode
|
+--comp.IdNode
- class IdNode
- extends ExprNode
Basic identifier expression.
Field Summary |
(package private) java.lang.String |
id
|
Constructor Summary |
IdNode(java.lang.String id)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
id
java.lang.String id
IdNode
public IdNode(java.lang.String id)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getType
public Type getType(Scope s)
- Overrides:
getType
in class ExprNode
codeGen
public java.lang.String codeGen(Scope scope,
RegBank bank)
- Description copied from class:
Node
- Generate code for this node. If the code is an expression it
should return a register name that holds the result. Otherwise null.
- Specified by:
codeGen
in class Node
lvalue
public java.lang.String lvalue(Scope scope,
RegBank bank)
- Answer the address of this name.
- Overrides:
lvalue
in class Node
rvalue
public java.lang.String rvalue(Scope scope,
RegBank bank)
- Answer the value of this name.
- Overrides:
rvalue
in class Node
asHTML
public void asHTML(java.io.PrintStream out)
- Process this node.
- Specified by:
asHTML
in class Node