|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.Utils
org.multijava.util.compiler.Phylum
org.multijava.mjc.JPhylum
org.multijava.mjc.JExpression
org.multijava.mjc.JBinaryExpression
org.multijava.mjc.JBinaryArithmeticExpression
org.multijava.mjc.JDivideExpression
This class represents the division binary expression.
| Field Summary | |
private boolean |
isInSafeMathMode
|
| Fields inherited from class org.multijava.mjc.JBinaryExpression |
left, right, type |
| Fields inherited from class org.multijava.mjc.JExpression |
EMPTY |
| Fields inherited from class org.multijava.util.compiler.Phylum |
|
| Fields inherited from class org.multijava.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
| Constructor Summary | |
JDivideExpression(TokenReference where,
JExpression left,
JExpression right)
Construct a node in the parsing tree. |
|
| Method Summary | |
void |
accept(MjcVisitor p)
Accepts the specified visitor |
double |
compute(double left,
double right)
Computes the result of the operation at compile-time (JLS 15.27). |
float |
compute(float left,
float right)
Computes the result of the operation at compile-time (JLS 15.27). |
int |
compute(int left,
int right,
CExpressionContextType context)
Computes the result of the operation at compile-time (JLS 15.27). |
long |
compute(long left,
long right,
CExpressionContextType context)
Computes the result of the operation at compile-time (JLS 15.27). |
static CType |
computeType(CType leftType,
CType rightType)
compute the type of this expression according to operands |
JExpression |
constantFolding(CExpressionContextType context)
Computes the result of the operation at compile-time (JLS 15.27). |
void |
genCode(CodeSequence code)
Generates a sequence of bytecodes |
static int |
getOpcode(CType type)
|
int |
safe_compute(int left,
int right)
|
long |
safe_compute(long left,
long right)
|
String |
toString()
|
JExpression |
typecheckBinaryArith(CExpressionContextType context)
Typechecks a binary arithmetic expression and handles simple optimizations like constant folding. |
JExpression |
verifyOperation(JExpression expr,
CExpressionContextType context)
Verify the operation. |
| Methods inherited from class org.multijava.mjc.JBinaryArithmeticExpression |
typecheck |
| Methods inherited from class org.multijava.mjc.JBinaryExpression |
genBooleanResultCode, genBranch, genBranch, getType, left, promote, right, setLeft, setRight, setType |
| Methods inherited from class org.multijava.mjc.JExpression |
buildUniverseDynChecks, clone, convertType, dumpArray, fail, genUniverseDynCheckCode, getApparentType, getBooleanLiteral, getFANonNulls, getFANulls, getLiteral, getNumberLiteral, getOrdinalLiteral, getRealLiteral, getStringLiteral, isAssignableTo, isBooleanLiteral, isConstant, isDeclaredNonNull, isLiteral, isMaybeInitializable, isNonNull, isOrdinalLiteral, isRealLiteral, isStatementExpression, isStringLiteral, typecheck, unParenthesize |
| Methods inherited from class org.multijava.mjc.JPhylum |
check, check, check, check, fail, fail, warn, warn, warn, warn |
| Methods inherited from class org.multijava.util.compiler.Phylum |
getTokenReference, setTokenReference |
| Methods inherited from class org.multijava.util.Utils |
assertTrue, assertTrue, combineArrays, escapeString, escapeString, fail, fail, getFilePath, hasFlag, hasOtherFlags, parsePathParts, relativePathTo, splitQualifiedName, splitQualifiedName, stripJavaModifiers, stripNonJavaModifiers, stripPrivateModifier, unescapeString, vectorToArray, vectorToIntArray |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private boolean isInSafeMathMode
| Constructor Detail |
public JDivideExpression(TokenReference where,
JExpression left,
JExpression right)
where - the line of this node in the source codeleft - the left operandright - the right operand| Method Detail |
public String toString()
toString in class Object
public JExpression typecheckBinaryArith(CExpressionContextType context)
throws PositionedError
context - the actual context of analysis
JExpression.typecheck())
PositionedError - if checks fail
public JExpression verifyOperation(JExpression expr,
CExpressionContextType context)
public static CType computeType(CType leftType,
CType rightType)
throws UnpositionedError
leftType - the type of left operandrightType - the type of right operand
UnpositionedError - this error will be positioned soon
public JExpression constantFolding(CExpressionContextType context)
throws UnpositionedError
UnpositionedError
public int safe_compute(int left,
int right)
throws UnpositionedError
UnpositionedError
public int compute(int left,
int right,
CExpressionContextType context)
left - the first operandright - the seconds operand
public long safe_compute(long left,
long right)
throws UnpositionedError
UnpositionedError
public long compute(long left,
long right,
CExpressionContextType context)
left - the first operandright - the seconds operand
public float compute(float left,
float right)
left - the first operandright - the seconds operand
public double compute(double left,
double right)
left - the first operandright - the seconds operand
public void accept(MjcVisitor p)
p - the visitorpublic static int getOpcode(CType type)
type - the type of result
public void genCode(CodeSequence code)
code - the code list
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||