ast
Class UnaryIncrExpr

java.lang.Object
  extended by ast.ASTNode
      extended by ast.Expr
          extended by ast.UnaryExpr
              extended by ast.UnaryIncrExpr

public class UnaryIncrExpr
extends UnaryExpr

The UnaryIncrExpr class represents increment shortcut expressions. It extends unary expressions so it contains an expression. Since this class is similar to other subclasses most of the functionality can be implemented in the visitor method for the parent class.

See Also:
ASTNode, Expr

Field Summary
protected  boolean isPostfix
          Boolean indicating whether operator is postfix (true) or prefix (false)
 
Fields inherited from class ast.UnaryExpr
expr
 
Fields inherited from class ast.ASTNode
charNum, lineNum, lineStr
 
Constructor Summary
UnaryIncrExpr(int lineNum, Expr expr, boolean isPostfix)
          UnaryIncrExpr constructor
 
Method Summary
 java.lang.Object accept(visitor.Visitor v, java.lang.Object o)
          Visitor method
 java.lang.String getOperandType()
          Get the operand type
 java.lang.String getOpName()
          Get the operation name
 java.lang.String getOpType()
          Get the operation type
 boolean isPostfix()
          Is this a postfix operator (as opposed to prefix)?
 
Methods inherited from class ast.UnaryExpr
getExpr
 
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

isPostfix

protected boolean isPostfix
Boolean indicating whether operator is postfix (true) or prefix (false)

Constructor Detail

UnaryIncrExpr

public UnaryIncrExpr(int lineNum,
                     Expr expr,
                     boolean isPostfix)
UnaryIncrExpr constructor

Parameters:
lineNum - source line number corresponding to this AST node
expr - expression for incrementing (expression must be either VarExpr or ArrayExpr)
isPostfix - boolean indicating whether operator is postfix (true) or prefix (false)
Method Detail

getOpName

public java.lang.String getOpName()
Get the operation name

Specified by:
getOpName in class UnaryExpr
Returns:
op name

getOpType

public java.lang.String getOpType()
Get the operation type

Specified by:
getOpType in class UnaryExpr
Returns:
op type

getOperandType

public java.lang.String getOperandType()
Get the operand type

Specified by:
getOperandType in class UnaryExpr
Returns:
operand type

isPostfix

public boolean isPostfix()
Is this a postfix operator (as opposed to prefix)?

Specified by:
isPostfix in class UnaryExpr
Returns:
boolean indicating whether postfix operator

accept

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

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