|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--openjava.ptree.ParseTreeObject | +--openjava.ptree.NonLeaf | +--openjava.ptree.AssignmentExpression
The AssignmentExpression
class represents
an assignment expression with an assignment operator.
Expression
Field Summary | |
static int |
ADD
|
static int |
AND
|
static int |
DIVIDE
|
static int |
EQUALS
|
static int |
MOD
|
static int |
MULT
|
private int |
opr
|
(package private) static String[] |
opr_string
|
static int |
OR
|
static int |
SHIFT_L
|
static int |
SHIFT_R
|
static int |
SHIFT_RR
|
static int |
SUB
|
static int |
XOR
|
Fields inherited from class openjava.ptree.NonLeaf |
|
Fields inherited from class openjava.ptree.ParseTreeObject |
debugFlag, debugLevel, LN, out, writerStack |
Constructor Summary | |
AssignmentExpression()
|
|
AssignmentExpression(Expression lexp,
int opr,
Expression rexp)
Allocates a new object. |
|
AssignmentExpression(Expression lexp,
String opr,
Expression rexp)
|
Method Summary | |
void |
accept(ParseTreeVisitor v)
Accepts a ParseTreeVisitor object as the role of a
Visitor in the Visitor pattern, as the role of an Element in the
Visitor pattern. |
Expression |
getLeft()
Gets the expression of the left operand. |
int |
getOperator()
Gets the id number of the operator. |
Expression |
getRight()
Gets the expression of the right operand. |
OJClass |
getType(Environment env)
|
ParseTree |
makeCopy()
Makes a new copy of this nonleaf-node as a ptree-node. |
ParseTree |
makeRecursiveCopy()
Makes a new copy (another object) of this nonleaf-node recursively. |
String |
operatorString()
|
void |
setLeft(Expression lexpr)
Sets the expression of the left operand. |
void |
setOperator(int opr)
Sets the id number of the operator. |
void |
setRight(Expression rexpr)
Sets the expression of the right operand. |
void |
writeCode()
Writes the code this parse-tree presents for. |
Methods inherited from class openjava.ptree.NonLeaf |
childrenAccept, childrenAreEqual, elementAt, equals, getComment, getContents, getLength, getRowType, replaceChildWith, set, set, set, set, set, set, set, set, set, setComment, setElementAt |
Methods inherited from class openjava.ptree.ParseTreeObject |
clone, eq, eq, equal, flushPrintWriter, getDebugFlag, getNest, getObjectID, getParent, getPrintWriter, getTab, hashCode, lastObjectID, popNest, popPrintWriter, pushNest, pushPrintWriter, replace, setDebugFlag, setDebugLevel, setNest, setParent, setPrintStream, setTab, toFlattenString, toString, writeDebug, writeDebugL, writeDebugLln, writeDebugln, writeDebugLR, writeDebugR, writeDebugRln, writeTab |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface openjava.ptree.Expression |
getRowType |
Methods inherited from interface openjava.ptree.ParseTree |
childrenAccept, eq, equals, getObjectID, replace, toFlattenString, toString |
Field Detail |
public static final int EQUALS
public static final int MULT
public static final int DIVIDE
public static final int MOD
public static final int ADD
public static final int SUB
public static final int SHIFT_L
public static final int SHIFT_R
public static final int SHIFT_RR
public static final int AND
public static final int XOR
public static final int OR
static final String[] opr_string
private int opr
Constructor Detail |
public AssignmentExpression(Expression lexp, int opr, Expression rexp)
lexp
- the left expression.opr
- the id number of the operator.rexp
- the right expression.public AssignmentExpression(Expression lexp, String opr, Expression rexp)
public AssignmentExpression()
Method Detail |
public ParseTree makeRecursiveCopy()
ParseTree
makeRecursiveCopy
in interface ParseTree
makeRecursiveCopy
in class NonLeaf
public ParseTree makeCopy()
ParseTree
makeCopy
in interface ParseTree
makeCopy
in class ParseTreeObject
public void writeCode()
NonLeaf
writeCode
in interface ParseTree
writeCode
in class NonLeaf
public Expression getLeft()
public void setLeft(Expression lexpr)
lexpr
- the left expression.public Expression getRight()
public void setRight(Expression rexpr)
rexpr
- the right expression.public int getOperator()
public void setOperator(int opr)
opr
- the id number of the operator.public String operatorString()
public void accept(ParseTreeVisitor v) throws ParseTreeException
ParseTree
ParseTreeVisitor
object as the role of a
Visitor in the Visitor pattern, as the role of an Element in the
Visitor pattern.
This invoke an appropriate visit()
method on the
accepted visitor.
accept
in interface ParseTree
accept
in class ParseTreeObject
v
- a visitor
ParseTreeException
public OJClass getType(Environment env) throws Exception
getType
in interface Expression
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |