ast
Class AssignExpr

java.lang.Object
  extended by ast.ASTNode
      extended by ast.Expr
          extended by ast.AssignExpr

public class AssignExpr
extends Expr

The AssignExpr class represents assignment expressions. It contains an optional reference name (potentially needed if the variable is a field), a variable name (variable being assigned to) and an expression (for assigning to the variable).

See Also:
ASTNode, Expr

Field Summary
protected  Expr expr
          The righthand expression for assigning to the lefthand variable
protected  java.lang.String name
          The name of the lefthand variable
protected  java.lang.String refName
          The optional reference object used to access the lefthand variable (only applicable if the variable is a field)
 
Fields inherited from class ast.ASTNode
charNum, lineNum, lineStr
 
Constructor Summary
AssignExpr(int lineNum, java.lang.String refName, java.lang.String name, Expr expr)
          AssignExpr constructor
 
Method Summary
 java.lang.Object accept(visitor.Visitor v, java.lang.Object o)
          Visitor method
 Expr getExpr()
          Get the righthand expression of the assignment
 java.lang.String getName()
          Get the lefthand variable name
 java.lang.String getRefName()
          Get the optional reference name
 
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
 

Field Detail

refName

protected java.lang.String refName
The optional reference object used to access the lefthand variable (only applicable if the variable is a field)


name

protected java.lang.String name
The name of the lefthand variable


expr

protected Expr expr
The righthand expression for assigning to the lefthand variable

Constructor Detail

AssignExpr

public AssignExpr(int lineNum,
                  java.lang.String refName,
                  java.lang.String name,
                  Expr expr)
AssignExpr constructor

Parameters:
lineNum - source line number corresponding to this AST node
refName - the optional reference object used to access the lefthand variable
name - the name of the lefthand variable
expr - righthand expression for assigning to the lefthand variable
Method Detail

getRefName

public java.lang.String getRefName()
Get the optional reference name

Returns:
reference name

getName

public java.lang.String getName()
Get the lefthand variable name

Returns:
lefthand variable name

getExpr

public Expr getExpr()
Get the righthand expression of the assignment

Returns:
righthand expression

accept

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

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