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
           
 
Fields inherited from class comp.Node
asm, globalScope, labelCount, strings
 
Constructor Summary
IdNode(java.lang.String id)
           
 
Method Summary
 void asHTML(java.io.PrintStream out)
          Process this node.
 java.lang.String codeGen(Scope scope, RegBank bank)
          Generate code for this node.
 Type getType(Scope s)
           
 java.lang.String lvalue(Scope scope, RegBank bank)
          Answer the address of this name.
 java.lang.String rvalue(Scope scope, RegBank bank)
          Answer the value of this name.
 java.lang.String toString()
           
 
Methods inherited from class comp.Node
addDefs, addString, getLabel, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

java.lang.String id
Constructor Detail

IdNode

public IdNode(java.lang.String id)
Method Detail

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