comp
Class AssignNode

java.lang.Object
  |
  +--comp.Node
        |
        +--comp.AssignNode

class AssignNode
extends Node

Assignment statement. Consists of a left and right expression.


Field Summary
(package private)  ExprNode left
           
(package private)  ExprNode right
           
 
Fields inherited from class comp.Node
asm, globalScope, labelCount, strings
 
Constructor Summary
AssignNode(ExprNode left, ExprNode right)
           
 
Method Summary
 void asHTML(java.io.PrintStream out)
          Process this node.
 java.lang.String codeGen(Scope scope, RegBank bank)
          Evaluate the left expression for its lvalue.
 java.lang.String toString()
           
 
Methods inherited from class comp.Node
addDefs, addString, getLabel, lvalue, reset, rvalue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

left

ExprNode left

right

ExprNode right
Constructor Detail

AssignNode

public AssignNode(ExprNode left,
                  ExprNode right)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

codeGen

public java.lang.String codeGen(Scope scope,
                                RegBank bank)
Evaluate the left expression for its lvalue. Evaluate the right expression. Then store the value into the address.

Specified by:
codeGen in class Node

asHTML

public void asHTML(java.io.PrintStream out)
Process this node.

Specified by:
asHTML in class Node