|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.llnl.babel.symbols.AssertionExpression
public abstract class AssertionExpression
Field Summary | |
---|---|
protected Context |
d_context
|
static java.lang.String |
ERROR_SEMANTIC_VALIDATION
|
Constructor Summary | |
---|---|
AssertionExpression(boolean valid,
Context context)
Used to initialize the basic expression attributes. |
Method Summary | |
---|---|
abstract java.lang.Object |
accept(ExprVisitor ev,
java.lang.Object data)
Implement the "visitor pattern". |
abstract java.lang.String |
cExpression(java.lang.String epvVar,
int[] startInd)
Return the C version of the expression. |
abstract java.util.ArrayList |
getArrayIterMacros(java.lang.String epvVar,
int[] startInd)
Return the list of array iteration macro messages, if any. |
abstract int |
getDefaultComplexity()
Return the default complexity of the expression. |
protected java.lang.String |
getExceptionPrefix(Extendable ext)
Return the prefix for exception messages based on the specified extendable. |
protected java.lang.String |
getExceptionPrefix(Extendable ext,
Method m)
Return the prefix for exception messages based on the specified extendable and method. |
abstract int |
getNumArrayIterMacrosByType(char type)
Returns the number of macros supported by this assertion of the specified type. |
Type |
getReturnType()
Return the return type. |
java.lang.String |
getReturnTypeName()
Return the name of the return type or, if empty, null. |
int |
getReturnTypeValue()
Return the value of the return type or -1 if no return type. |
abstract boolean |
hasBuiltinMethod(int type)
Return TRUE if the expression is, or has, the specified built-in method call; otherwise, return FALSE. |
abstract boolean |
hasMethodCall()
Return TRUE if the expression is, or has, at least one method call; otherwise, return FALSE. |
boolean |
hasParens()
Return TRUE if the original expression had parentheses; otherwise, return FALSE. |
abstract boolean |
hasPure()
Return TRUE if the expression is, or has, a PURE clause; otherwise, return FALSE. |
abstract boolean |
hasResult()
Return TRUE if the expression contains RESULT; otherwise, return FALSE. |
abstract boolean |
hasResultOrArg()
Return TRUE if a result clause or method argument is found within the expression; otherwise, return FALSE. |
abstract boolean |
hasResultOrOutArg(boolean outOnly)
Return TRUE if a result clause or output argument is found within the expression; otherwise, return FALSE. |
abstract boolean |
hasUserDefinedMethod(boolean any)
Return TRUE if the expression has a method AND the method is any user-defined method (when any is TRUE) or it is an user-defined method with a throws clause (if any is FALSE); otherwise, return FALSE. |
boolean |
isValid()
Return TRUE if the expression has been marked as having passed the validation checks; otherwise, return FALSE. |
boolean |
leftAssociative()
Return true iff the operator is parsed left to right. |
abstract boolean |
requiresExtendableContext()
Return TRUE if extendable context is required to validate the expression; otherwise, return FALSE. |
abstract boolean |
requiresMethodContext()
Return TRUE if method context is required to validate the expression; otherwise, return FALSE. |
boolean |
returnIsArray()
Return TRUE if the return type is an array; otherwise, return FALSE. |
boolean |
returnIsBoolean()
Return TRUE if the return type is a boolean; otherwise, return FALSE. |
boolean |
returnIsCharacter()
Return TRUE if the return type is a character; otherwise, return FALSE. |
boolean |
returnIsClass()
Return TRUE if the return type is a class; otherwise, return FALSE. |
boolean |
returnIsDComplex()
Return TRUE if the return type is a double complex; otherwise, return FALSE. |
boolean |
returnIsDouble()
Return TRUE if the return type is a double; otherwise, return FALSE. |
boolean |
returnIsEnum()
Return TRUE if the return type is an enumeration; otherwise, return FALSE. |
boolean |
returnIsFComplex()
Return TRUE if the return type is a float complex; otherwise, return FALSE. |
boolean |
returnIsFloat()
Return TRUE if the return type is a float; otherwise, return FALSE. |
boolean |
returnIsInteger()
Return TRUE if the return type is a integer; otherwise, return FALSE. |
boolean |
returnIsInterface()
Return TRUE if the return type is an interface; otherwise, return FALSE. |
boolean |
returnIsLong()
Return TRUE if the return type is a long; otherwise, return FALSE. |
boolean |
returnIsNumericArray()
Return TRUE if the return type is an array; otherwise, return FALSE. |
boolean |
returnIsOpaque()
Return TRUE if the return type is a opaque; otherwise, return FALSE. |
boolean |
returnIsString()
Return TRUE if the return type is a string; otherwise, return FALSE. |
void |
setParens(boolean parens)
Sets the parens attribute to reflect whether or not the expression is specified to be contained within parentheses. |
protected void |
setReturnToBoolean()
Set the return type to boolean. |
protected void |
setReturnToCharacter()
Set the return type to character. |
protected void |
setReturnToClass()
Set the return type to class. |
protected void |
setReturnToDComplex()
Set the return type to double complex. |
protected void |
setReturnToDouble()
Set the return type to double. |
protected void |
setReturnToEnum()
Set the return type to enumeration. |
protected void |
setReturnToFComplex()
Set the return type to float complex. |
protected void |
setReturnToFloat()
Set the return type to float. |
protected void |
setReturnToInteger()
Set the return type to integer. |
protected void |
setReturnToInterface()
Set the return type to interface. |
protected void |
setReturnToLong()
Set the return type to long. |
protected void |
setReturnToOpaque()
Set the return type to opaque. |
protected void |
setReturnToString()
Set the return type to string. |
protected void |
setReturnType(int return_type)
Set the return type associated with the expression based on the specified type value. |
protected void |
setReturnType(Type return_type)
Set the return type associated with the expression based on the value associated with the specified return type. |
abstract java.lang.String |
toString()
Return the stringified version of the expression (in SIDL form). |
void |
validateExpression(Extendable ext,
Method m)
Validate this assertion expression within the context of the given extendable and optional method. |
protected abstract void |
validateSemantics(Extendable ext,
Method m)
Validate the expression semantics, if necessary, within the context of the extendable and/or method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Context d_context
public static final java.lang.String ERROR_SEMANTIC_VALIDATION
Constructor Detail |
---|
public AssertionExpression(boolean valid, Context context)
valid
- Use TRUE only if the expression is clearly valid from the
start (e.g., most literals).Method Detail |
---|
public void setParens(boolean parens)
parens
- TRUE if the expression is known to be specified to be
contained within parentheses; FALSE otherwise.public boolean hasParens()
protected void setReturnType(int return_type) throws AssertionException
return_type
- A return type value for this expression.
AssertionException
- The exception raised if the specified return type is
still not determined.protected void setReturnType(Type return_type) throws AssertionException
return_type
- A return type containing the value for this
expression.
AssertionException
- The exception raised if the specified return type is
still not determined.public Type getReturnType()
public java.lang.String getReturnTypeName()
public int getReturnTypeValue()
public boolean returnIsArray()
public boolean returnIsBoolean()
public boolean returnIsCharacter()
public boolean returnIsDComplex()
public boolean returnIsDouble()
public boolean returnIsFComplex()
public boolean returnIsFloat()
public boolean returnIsInteger()
public boolean returnIsLong()
public boolean returnIsNumericArray()
public boolean returnIsOpaque()
public boolean returnIsString()
public boolean returnIsEnum()
public boolean returnIsClass()
public boolean returnIsInterface()
protected void setReturnToBoolean() throws AssertionException
AssertionException
protected void setReturnToCharacter() throws AssertionException
AssertionException
protected void setReturnToDComplex() throws AssertionException
AssertionException
protected void setReturnToDouble() throws AssertionException
AssertionException
protected void setReturnToFComplex() throws AssertionException
AssertionException
protected void setReturnToFloat() throws AssertionException
AssertionException
protected void setReturnToInteger() throws AssertionException
AssertionException
protected void setReturnToLong() throws AssertionException
AssertionException
protected void setReturnToOpaque() throws AssertionException
AssertionException
protected void setReturnToString() throws AssertionException
AssertionException
protected void setReturnToEnum() throws AssertionException
AssertionException
protected void setReturnToClass() throws AssertionException
AssertionException
protected void setReturnToInterface() throws AssertionException
AssertionException
public boolean isValid()
public abstract boolean hasPure()
public abstract boolean hasResult()
public abstract boolean hasResultOrArg()
public abstract boolean hasResultOrOutArg(boolean outOnly)
outOnly
- TRUE if only concerned with output arguments that are
out only; FALSE otherwise.public abstract boolean hasMethodCall()
public abstract int getDefaultComplexity()
public abstract boolean hasBuiltinMethod(int type)
public abstract boolean hasUserDefinedMethod(boolean any)
public abstract boolean requiresExtendableContext()
public abstract boolean requiresMethodContext()
protected java.lang.String getExceptionPrefix(Extendable ext, Method m)
ext
- The interface or class that owns this expression.m
- The method that owns this expression.protected java.lang.String getExceptionPrefix(Extendable ext)
ext
- The interface or class that owns this expression.protected abstract void validateSemantics(Extendable ext, Method m) throws AssertionException
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 void validateExpression(Extendable ext, Method m) throws AssertionException
ext
- The interface or class that owns this expression.m
- The method that owns this expression.
AssertionException
- The exception raised if sufficient context is unavailable
or that can be propagated by validations.public abstract java.util.ArrayList getArrayIterMacros(java.lang.String epvVar, int[] startInd)
public abstract int getNumArrayIterMacrosByType(char type)
public abstract java.lang.String cExpression(java.lang.String epvVar, int[] startInd)
AssertionException
- this indicates that the expression
contained unsupported node types.public boolean leftAssociative()
true
iff the operator is parsed left to right.
public abstract java.lang.String toString()
toString
in class java.lang.Object
public abstract java.lang.Object accept(ExprVisitor ev, java.lang.Object data)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |