ast
Class ArrayAssignExpr

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

public class ArrayAssignExpr
extends Expr

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

See Also:
ASTNode, Expr

Field Summary
protected  Expr expr
          The righthand expression for assigning to the lefthand variable
protected  Expr index
          The index expression
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
ArrayAssignExpr(int lineNum, java.lang.String refName, java.lang.String name, Expr index, Expr expr)
          ArrayAssignExpr 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
 Expr getIndex()
          Get the index expression
 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


index

protected Expr index
The index expression


expr

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

Constructor Detail

ArrayAssignExpr

public ArrayAssignExpr(int lineNum,
                       java.lang.String refName,
                       java.lang.String name,
                       Expr index,
                       Expr expr)
ArrayAssignExpr 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
index - index expression
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

getIndex

public Expr getIndex()
Get the index expression

Returns:
index expression

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