|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectast.ASTNode
ast.Expr
ast.UnaryExpr
public abstract class UnaryExpr
The abstract UnaryExpr class represents unary expressions whose operand is an expression (i.e., this does not include new constructions). It can be either a negation expression ('-'), a complement expression ('!'), an increment expression ('++'), or a decrement expression ('--'). It contains an expression. Subclasses of this class can be handled similarly within the compiler, so most functionality can be implemented in the visitor method for this class.
ASTNode,
Expr| Field Summary | |
|---|---|
protected Expr |
expr
The expression |
| Fields inherited from class ast.ASTNode |
|---|
charNum, lineNum, lineStr |
| Constructor Summary | |
|---|---|
UnaryExpr(int lineNum,
Expr expr)
UnaryExpr constructor |
|
| Method Summary | |
|---|---|
abstract java.lang.Object |
accept(Visitor v)
Visitor method |
Expr |
getExpr()
Get the expression |
abstract java.lang.String |
getOperandType()
Get the operand type (e.g., "boolean") (must be defined by each subclass) |
abstract java.lang.String |
getOpName()
Get the operation name (e.g., "!") (must be defined by each subclass) |
abstract java.lang.String |
getOpType()
Get the operation type (e.g., "boolean") (must be defined by each subclass) |
abstract boolean |
isPostfix()
Is this a postfix operator (as opposed to prefix)? |
| 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 |
|---|
protected Expr expr
| Constructor Detail |
|---|
public UnaryExpr(int lineNum,
Expr expr)
lineNum - source line number corresponding to this AST nodeexpr - expression| Method Detail |
|---|
public Expr getExpr()
public abstract java.lang.String getOpName()
public abstract java.lang.String getOpType()
public abstract java.lang.String getOperandType()
public abstract boolean isPostfix()
public abstract java.lang.Object accept(Visitor v)
accept in class Exprv - visitor object
Visitor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||