comp
Class BinExprNode

java.lang.Object
  |
  +--comp.Node
        |
        +--comp.ExprNode
              |
              +--comp.BinExprNode

class BinExprNode
extends ExprNode

Binary expression node. Consists of an integer operator (which is one of the ones defined by our assembler. A string representation of this operator (used really for printing only), and two subexpressions.


Field Summary
(package private)  ExprNode left
           
(package private)  int op
           
(package private)  java.lang.String opString
           
(package private)  ExprNode right
           
 
Fields inherited from class comp.Node
asm, globalScope, labelCount, strings
 
Constructor Summary
BinExprNode(java.lang.String opString, int op, ExprNode left, ExprNode right)
           
 
Method Summary
 void asHTML(java.io.PrintStream out)
          Process the pieces of node.
 java.lang.String codeGen(Scope scope, RegBank bank)
          Generate code for the left and right expressions, and then apply the binary operator to those results.
 Type getType(Scope s)
           
 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

op

int op

opString

java.lang.String opString
Constructor Detail

BinExprNode

public BinExprNode(java.lang.String opString,
                   int op,
                   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)
Generate code for the left and right expressions, and then apply the binary operator to those results.

Specified by:
codeGen in class Node

asHTML

public void asHTML(java.io.PrintStream out)
Process the pieces of node.

Specified by:
asHTML in class Node

getType

public Type getType(Scope s)