public class MethodCall extends AssertionExpression
d_context, ERROR_SEMANTIC_VALIDATION
Constructor and Description |
---|
MethodCall(java.lang.String name,
Context context)
Create a new object.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
accept(ExprVisitor ev,
java.lang.Object data)
Implement the "visitor pattern".
|
void |
addArgument(AssertionExpression arg)
Add the specified expression as an argument to the method call.
|
java.lang.String |
cExpression(java.lang.String epvVar,
int[] startInd)
Return the C version of the expression.
|
java.util.ArrayList |
getArgumentReturnTypes(Method meth)
Return a list of argument return type values (Integer) that correspond to
the Type class equivalents of the arguments associated with the specified
method.
|
java.util.ArrayList |
getArguments()
Return an
ArrayList of argument expressions with each
element as a AssertionExpression . |
java.util.ArrayList |
getArrayIterMacros(java.lang.String epvVar,
int[] startInd)
Return the list of array iteration macros, if any.
|
int |
getDefaultComplexity()
Return the default complexity of the expression (0 = constant, 1 = linear,
etc.).
|
java.lang.String |
getMethodName()
Return the name of the method call.
|
int |
getNumArrayIterMacrosByType(char type)
Returns the number of macros supported by this assertion of the
specified type.
|
boolean |
hasBuiltinMethod(int type)
Return TRUE if the expression is, or has, the specified built-in method;
otherwise, return FALSE.
|
boolean |
hasCompatibleArgumentTypes(java.util.ArrayList list)
Return TRUE if the specified argument type list is compatible with
the arguments in this call; otherwise, return FALSE.
|
boolean |
hasMethodCall()
Return TRUE if the expression is, or has, at least one method call;
otherwise, return FALSE.
|
boolean |
hasPure()
Return TRUE if the expression is, or has, PURE clause; otherwise,
return FALSE.
|
boolean |
hasResult()
Return TRUE if the expression contains RESULT; otherwise, return FALSE.
|
boolean |
hasResultOrArg()
Return TRUE if a result clause or method argument is found within the
expression; otherwise, return FALSE.
|
boolean |
hasResultOrOutArg(boolean outOnly)
Return TRUE if a result clause or output argument is found within the
expression; otherwise, return FALSE.
|
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 |
isArrayMacroMethod()
Return TRUE if the method is one of the special array macro ones;
otherwise, return FALSE.
|
boolean |
isArrayMethod()
Return TRUE if the method is one of the special array ones; otherwise,
return FALSE.
|
boolean |
isBuiltinNumericArrayMethod()
Return TRUE if the method is one of the special built-in ones whose
array argument(s) must contain numeric values only.
|
boolean |
isBuiltinRelationMethod()
Return TRUE if the method is one of the special built-in ones whose
only argument should be a relation; otherwise, return FALSE.
|
boolean |
isStatic()
Return TRUE if the user-defined method is static; 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.
|
boolean |
throwsExceptions()
Return TRUE if the user-defined method throws exceptions; otherwise,
return FALSE.
|
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, if necessary, within the context of the
extendable and optional method.
|
getExceptionPrefix, getExceptionPrefix, getReturnType, getReturnTypeName, getReturnTypeValue, hasParens, isValid, leftAssociative, returnIsArray, returnIsBoolean, returnIsCharacter, returnIsClass, returnIsDComplex, returnIsDouble, returnIsEnum, returnIsFComplex, returnIsFloat, returnIsInteger, returnIsInterface, returnIsLong, returnIsNumericArray, returnIsOpaque, returnIsString, setParens, setReturnToBoolean, setReturnToCharacter, setReturnToClass, setReturnToDComplex, setReturnToDouble, setReturnToEnum, setReturnToFComplex, setReturnToFloat, setReturnToInteger, setReturnToInterface, setReturnToLong, setReturnToOpaque, setReturnToString, setReturnType, setReturnType, validateExpression
public static final java.lang.String ARRAY_BOOLEAN_RESULT_VAR
public static final java.lang.String ARRAY_COUNT_VAR
public static final java.lang.String ARRAY_DOUBLE_RESULT_VAR
public static final java.lang.String ARRAY_INTEGER_RESULT_VAR
public static final java.lang.String ARRAY_ITER_VAR
public static final java.lang.String ARRAY_SIZE_VAR
public static final char[] MACRO_RETURN_TYPE
public static final int MACRO_RETURNS_BOOLEAN_IND
public static final int MACRO_RETURNS_DOUBLE_IND
public static final int MACRO_RETURNS_INTEGER_IND
public static final int MAX_VALID_MACRO_RETURNS
public static final int METHOD_ANY_ARRAY
public static final int METHOD_NUMERIC_ARRAY
public static final int METHOD_ANY_BUILTIN
public static final int METHOD_IS_USER_DEFINED
public static final int METHOD_ARRAY_ALL
public static final int METHOD_ARRAY_ANY
public static final int METHOD_ARRAY_COUNT
public static final int METHOD_ARRAY_DIMEN
public static final int METHOD_ARRAY_IRANGE
public static final int METHOD_ARRAY_LOWER
public static final int METHOD_ARRAY_MAX
public static final int METHOD_ARRAY_MIN
public static final int METHOD_ARRAY_NEAR_EQUAL
public static final int METHOD_ARRAY_NON_DECR
public static final int METHOD_ARRAY_NON_INCR
public static final int METHOD_ARRAY_NONE
public static final int METHOD_ARRAY_RANGE
public static final int METHOD_ARRAY_SIZE
public static final int METHOD_ARRAY_STRIDE
public static final int METHOD_ARRAY_SUM
public static final int METHOD_ARRAY_UPPER
public static final int METHOD_IRANGE
public static final int METHOD_NEAR_EQUAL
public static final int METHOD_RANGE
public static final int MINIMUM_METHOD
public static final int MAXIMUM_ARRAY_METHOD
public static final int MAXIMUM_METHOD
public static final int METHOD_RELATION_NONE
public static final int METHOD_RELATION_LEFT
public static final int METHOD_RELATION_RIGHT
public static final int METHOD_RELATION_BOTH
public static final int RELATION_OP_EQUAL
public static final int RELATION_OP_NOT_EQUAL
public static final int RELATION_OP_LESS_THAN
public static final int RELATION_OP_LESS_EQUAL
public static final int RELATION_OP_GREATER_THAN
public static final int RELATION_OP_GREATER_EQUAL
public MethodCall(java.lang.String name, Context context) throws AssertionException
name
- The name of the method that is to be called.AssertionException
- The exception raised if error during any validation.public java.lang.String getMethodName()
public boolean isStatic()
public boolean throwsExceptions()
public void addArgument(AssertionExpression arg)
arg
- An assertion expression as an argument to the method call.public java.util.ArrayList getArguments()
ArrayList
of argument expressions with each
element as a AssertionExpression
.public boolean isArrayMethod()
public boolean isArrayMacroMethod()
public boolean isBuiltinNumericArrayMethod()
public boolean isBuiltinRelationMethod()
public boolean hasPure()
hasPure
in class AssertionExpression
public boolean hasResult()
hasResult
in class AssertionExpression
public boolean hasResultOrArg()
hasResultOrArg
in class AssertionExpression
public boolean hasResultOrOutArg(boolean outOnly)
hasResultOrOutArg
in class AssertionExpression
outOnly
- TRUE if only concerned with output arguments that are
out only; FALSE otherwise.public boolean hasMethodCall()
hasMethodCall
in class AssertionExpression
public int getDefaultComplexity()
getDefaultComplexity
in class AssertionExpression
public boolean hasBuiltinMethod(int type)
hasBuiltinMethod
in class AssertionExpression
public boolean hasUserDefinedMethod(boolean any)
hasUserDefinedMethod
in class AssertionExpression
public boolean requiresExtendableContext()
requiresExtendableContext
in class AssertionExpression
public boolean requiresMethodContext()
requiresMethodContext
in class AssertionExpression
public java.util.ArrayList getArgumentReturnTypes(Method meth)
ArrayList
is an
Integer
.public boolean hasCompatibleArgumentTypes(java.util.ArrayList list) throws AssertionException
AssertionException
- The exception is raised if there is a problem with any of the
argument return types (e.g., return type not yet determined).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.lang.String toString()
toString
in class AssertionExpression
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.Object accept(ExprVisitor ev, java.lang.Object data)
AssertionExpression
accept
in class AssertionExpression