Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
gov.llnl.babel.symbols.AssertionExpression
gov.llnl.babel.symbols.Literal
gov.llnl.babel.symbols.IdentifierLiteral
public class IdentifierLiteral
extends Literal
Field Summary | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int |
Fields inherited from class gov.llnl.babel.symbols.AssertionExpression | |
ERROR_SEMANTIC_VALIDATION , d_context |
Constructor Summary | |
|
Method Summary | |
Object |
|
String |
|
ArrayList |
|
String |
|
int |
|
String |
|
int |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
String |
|
protected void |
|
public static final int ARGUMENT
- Field Value:
- 0
public static final int IN
- Field Value:
- 0
public static final int INOUT
- Field Value:
- 1
public static final int NULL
- Field Value:
- 1
public static final int OUT
- Field Value:
- 2
public static final int PURE
- Field Value:
- 2
public static final int RESULT
- Field Value:
- 3
public IdentifierLiteral(String id, Context context) throws AssertionException
Construct a new object.
- Parameters:
id
- The string identifier.
- Throws:
AssertionException
- An exception that could be raised during any validation.
public Object accept(ExprVisitor ev, Object data)
Implement the "visitor pattern".
- Overrides:
- accept in interface AssertionExpression
public String cExpression(String epvVar, int[] startInd)
Return the C version of the expression. WARNING: This should NOT be invoked for special literals such as PURE because there is nothing to check, which means that the expression in the if-statement will be empty!
- Overrides:
- cExpression in interface AssertionExpression
public ArrayList getArrayIterMacros(String epvVar, int[] startInd)
Return the list of array iteration macro messages, if any. Each message is a string where the first character indicates the return type associated with the iteration. The remaining characters will be the actual macro invocation.
- Overrides:
- getArrayIterMacros in interface AssertionExpression
public String getIdentifier()
Return the identifier.
public int getIdentifierType()
Return the identifier type.
public String getIdentifierTypeName()
Return the name of the identifier type. It is assumed the code for the type is valid since it is set internally in the constructor.
public int getNumArrayIterMacrosByType(char type)
Returns the number of macros supported by this assertion of the specified type. Valid types are given in MethodCall.java.
- Overrides:
- getNumArrayIterMacrosByType in interface AssertionExpression
public boolean hasMethodCall()
Return TRUE if the expression has at least one method call; otherwise, return FALSE. Since this is an identifier it cannot be a method call.
- Overrides:
- hasMethodCall in interface AssertionExpression
public boolean hasPure()
Return TRUE if the expression is a PURE clause; otherwise, return FALSE. In this case, TRUE will be returned if the identifier is "pure".
- Overrides:
- hasPure in interface AssertionExpression
public boolean hasReservedMethod(int type)
Return TRUE if the expression is, or has, the specified reserved method call; otherwise, return FALSE.
- Overrides:
- hasReservedMethod in interface AssertionExpression
public boolean hasResult()
Return TRUE if the expression contains RESULT; otherwise, return FALSE.
- Overrides:
- hasResult in interface AssertionExpression
public 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.
- Overrides:
- hasUnreservedMethod in interface AssertionExpression
public boolean isArgument()
Return TRUE if the identifier is ARGUMENT; otherwise, return FALSE.
public boolean isNull()
Return TRUE if the identifier is NULL; otherwise, return FALSE.
public boolean isReserved()
Return TRUE if the identifier is a reserved keyword; otherwise, return FALSE.
public boolean requiresExtendableContext()
Return TRUE if extendable context is required to validate the expression; otherwise, return FALSE.
- Overrides:
- requiresExtendableContext in interface AssertionExpression
public boolean requiresMethodContext()
Return TRUE if method context is required to validate the expression; otherwise, return FALSE. This is separate from and in addition to the extendable context.
- Overrides:
- requiresMethodContext in interface AssertionExpression
public String toString()
Return the stringified version of the expression (in SIDL form).
- Overrides:
- toString in interface AssertionExpression
protected void validateSemantics(Extendable ext, Method m) throws AssertionException
Validate the expression semantics, if necessary, within the context of the extendable and optional method. Assumptions: 1) If this is NULL, then it is associated either with a binary expression or a method call. In either case, it is assumed the corresponding expression container has already set the return type of this expression since there is no reasonable way to determine it here. 2) ARGUMENT is (the name of) an argument of the specified method that is supposed to be used in a method call. 3) RESULT is the return value associated with the specified method within the specified extendable.
- Overrides:
- validateSemantics in interface AssertionExpression
- Parameters:
ext
- The interface or class that owns this expression.m
- The method that owns this expression.
- Throws:
AssertionException
- The exception raised if errors in any validation.