|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.llnl.babel.symbols.AssertionExpression
gov.llnl.babel.symbols.BinaryExpression
public class BinaryExpression
Field Summary | |
---|---|
static int |
BITWISE_AND
|
static int |
BITWISE_OR
|
static int |
BITWISE_XOR
|
static int |
DIVIDE
|
static int |
EQUALS
|
static int |
GREATER_EQUAL
|
static int |
GREATER_THAN
|
static int |
IF_AND_ONLY_IF
|
static int |
IMPLIES
|
static int |
LESS_EQUAL
|
static int |
LESS_THAN
|
static int |
LOGICAL_AND
|
static int |
LOGICAL_OR
|
static int |
LOGICAL_XOR
|
static int |
MAX_OP_VALUE
|
static int |
MIN_OP_VALUE
|
static int |
MINUS
|
static int |
MODULUS
|
static int |
MULTIPLY
|
static int |
NOOP
|
static int |
NOT_EQUAL
|
static int |
PLUS
|
static int |
POWER
|
static int |
REMAINDER
|
static int |
SHIFT_LEFT
|
static int |
SHIFT_RIGHT
|
Fields inherited from class gov.llnl.babel.symbols.AssertionExpression |
---|
d_context, ERROR_SEMANTIC_VALIDATION |
Constructor Summary | |
---|---|
BinaryExpression(AssertionExpression lhs,
int op,
AssertionExpression rhs,
Context context)
Construct a new object. |
Method Summary | |
---|---|
java.lang.Object |
accept(ExprVisitor ev,
java.lang.Object data)
Implement the "visitor pattern". |
boolean |
arrayOnLeft()
Return TRUE if an array appears on the LHS; otherwise, FALSE. |
boolean |
arrayOnRight()
Return TRUE if an array appears on the RHS; otherwise, FALSE. |
java.lang.String |
cExpression(java.lang.String epvVar,
int[] startInd)
Return the C version of the expression. |
java.util.ArrayList |
getArrayIterMacros(java.lang.String epvVar,
int[] startInd)
Return the list of array iteration macro messages, if any. |
java.lang.String |
getArrayRelation()
Return the array relation only. |
java.lang.String |
getArrayRelationVariable(boolean onLeft)
Return the specified array relation's array variable. |
AssertionExpression |
getLeftExpression()
Return the left-hand expression. |
int |
getNumArrayIterMacrosByType(char type)
Returns the number of macros supported by this assertion of the specified type. |
int |
getOp()
Return the binary operator. |
java.lang.String |
getOpSymbol()
Return the symbol associated with the operator. |
AssertionExpression |
getRightExpression()
Return the right-hand expression. |
boolean |
hasMethodCall()
Return TRUE if the expression has at least one method call; otherwise, return FALSE. |
boolean |
hasPure()
Return TRUE if the expression has an "is pure" clause; otherwise, return FALSE. |
boolean |
hasReservedMethod(int type)
Return TRUE if the expression is, or has, the specified reserved method call; otherwise, return FALSE. |
boolean |
hasResult()
Return TRUE if the expression uses the "result" keyword; otherwise, return FALSE. |
boolean |
hasUnreservedMethod(boolean any)
Return TRUE if the method is any unreserved method (when any is TRUE) or it is an unreserved method with a throws clause (if any is FALSE); otherwise, return FALSE. |
boolean |
isArrayRelationRequired()
Return TRUE if the array relation is required (during validation); otherwise, return FALSE. |
boolean |
requiresExtendableContext()
Return TRUE if extendable context is required to validate the expression; otherwise, return FALSE. |
boolean |
requiresMethodContext()
Return TRUE if method context is required to validate the expression; otherwise, return FALSE. |
void |
setArrayRelationRequired(boolean isReq)
Set the array relation required attribute. |
java.lang.String |
toString()
Return the stringified version of the expression (in SIDL form). |
protected void |
validateSemantics(Extendable ext,
Method m)
Validate the expression semantics, first ensuring both subexpressions are valid then that the binary expression is valid for the specified operator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int NOOP
public static final int LOGICAL_AND
public static final int DIVIDE
public static final int EQUALS
public static final int GREATER_EQUAL
public static final int GREATER_THAN
public static final int IF_AND_ONLY_IF
public static final int IMPLIES
public static final int LESS_EQUAL
public static final int LESS_THAN
public static final int MINUS
public static final int MODULUS
public static final int MULTIPLY
public static final int NOT_EQUAL
public static final int LOGICAL_OR
public static final int PLUS
public static final int POWER
public static final int REMAINDER
public static final int SHIFT_LEFT
public static final int SHIFT_RIGHT
public static final int LOGICAL_XOR
public static final int BITWISE_AND
public static final int BITWISE_OR
public static final int BITWISE_XOR
public static final int MIN_OP_VALUE
public static final int MAX_OP_VALUE
Constructor Detail |
---|
public BinaryExpression(AssertionExpression lhs, int op, AssertionExpression rhs, Context context) throws AssertionException
lhs
- The expression on the left side of the operator.op
- The binary operator.rhs
- The expression on the right side of the operator.
AssertionException
- The exception raised if the specified return type is
out of range, the operator invalid, or either the left
or right expression is null.Method Detail |
---|
public AssertionExpression getLeftExpression()
public int getOp()
public java.lang.String getOpSymbol()
public AssertionExpression getRightExpression()
public void setArrayRelationRequired(boolean isReq)
public boolean isArrayRelationRequired()
public java.lang.String getArrayRelationVariable(boolean onLeft)
public java.lang.String getArrayRelation()
public boolean arrayOnLeft()
public boolean arrayOnRight()
public boolean hasPure()
hasPure
in class AssertionExpression
public boolean hasResult()
hasResult
in class AssertionExpression
public boolean hasMethodCall()
hasMethodCall
in class AssertionExpression
public boolean hasReservedMethod(int type)
hasReservedMethod
in class AssertionExpression
public boolean hasUnreservedMethod(boolean any)
hasUnreservedMethod
in class AssertionExpression
public boolean requiresExtendableContext()
requiresExtendableContext
in class AssertionExpression
public boolean requiresMethodContext()
requiresMethodContext
in class AssertionExpression
protected void validateSemantics(Extendable ext, Method m) throws AssertionException
validateSemantics
in class AssertionExpression
ext
- The interface or class that owns this expression.m
- The method that owns this expression.
AssertionException
- The exception that can be raised during the validation.public java.util.ArrayList getArrayIterMacros(java.lang.String epvVar, int[] startInd)
getArrayIterMacros
in class AssertionExpression
public int getNumArrayIterMacrosByType(char type)
getNumArrayIterMacrosByType
in class AssertionExpression
public java.lang.String cExpression(java.lang.String epvVar, int[] startInd)
cExpression
in class AssertionExpression
public java.lang.String toString()
toString
in class AssertionExpression
public java.lang.Object accept(ExprVisitor ev, java.lang.Object data)
accept
in class AssertionExpression
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |