ast
Class BinaryArithExpr

java.lang.Object
  extended by ast.ASTNode
      extended by ast.Expr
          extended by ast.BinaryExpr
              extended by ast.BinaryArithExpr
Direct Known Subclasses:
BinaryArithDivideExpr, BinaryArithMinusExpr, BinaryArithModulusExpr, BinaryArithPlusExpr, BinaryArithTimesExpr

public abstract class BinaryArithExpr
extends BinaryExpr

The abstract BinaryArithExpr class represents arithmetic expressions. It can be either plus ('+'), minus ('-'), times ('*'), divide ('/'), or modulus ('%'). It extends BinaryExpr and contains a lefthand expression and a righthand expression. Most of the functionality can be implemented within the visitor method for BinaryExpr, however, some functionality may need to be implemented in the visitor method for each subclass.

See Also:
ASTNode, BinaryExpr

Field Summary
 
Fields inherited from class ast.BinaryExpr
leftExpr, rightExpr
 
Fields inherited from class ast.ASTNode
charNum, lineNum, lineStr
 
Constructor Summary
BinaryArithExpr(int lineNum, Expr leftExpr, Expr rightExpr)
          BinaryArithExpr constructor
 
Method Summary
abstract  java.lang.Object accept(visitor.Visitor v, java.lang.Object o)
          Visitor method
 
Methods inherited from class ast.BinaryExpr
getLeftExpr, getOperandType, getOpName, getOpType, getRightExpr
 
Methods inherited from class ast.Expr
getExprType, setExprType
 
Methods inherited from class ast.ASTNode
getLineNum
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryArithExpr

public BinaryArithExpr(int lineNum,
                       Expr leftExpr,
                       Expr rightExpr)
BinaryArithExpr constructor

Parameters:
lineNum - source line number corresponding to this AST node
leftExpr - left operand expression
rightExpr - right operand expression
Method Detail

accept

public abstract java.lang.Object accept(visitor.Visitor v,
                                        java.lang.Object o)
Visitor method

Specified by:
accept in class BinaryExpr
Parameters:
v - visitor object
o - object to pass down
Returns:
result of visiting this node
See Also:
Visitor