gov.llnl.babel.symbols
Class LongLiteral

java.lang.Object
  extended by gov.llnl.babel.symbols.AssertionExpression
      extended by gov.llnl.babel.symbols.Literal
          extended by gov.llnl.babel.symbols.LongLiteral

public class LongLiteral
extends Literal


Field Summary
 
Fields inherited from class gov.llnl.babel.symbols.AssertionExpression
d_context, ERROR_SEMANTIC_VALIDATION
 
Constructor Summary
LongLiteral(java.lang.Long value, java.lang.String image, Context context)
          Create a new object.
 
Method Summary
 java.lang.Object accept(ExprVisitor ev, java.lang.Object data)
          Implement the "visitor pattern".
 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.
 int getDefaultComplexity()
          Return the default complexity of the expression (0 = constant, 1 = linear, etc.).
 java.lang.String getImage()
          Return the string image of the literal.
 int getNumArrayIterMacrosByType(char type)
          Returns the number of macros supported by this assertion of the specified type.
 java.lang.Long getValue()
          Return the value of the literal.
 boolean hasBuiltinMethod(int type)
          Return TRUE if the expression is, or has, the specified built-in method 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, a 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 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.
 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.
 
Methods inherited from class gov.llnl.babel.symbols.AssertionExpression
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LongLiteral

public LongLiteral(java.lang.Long value,
                   java.lang.String image,
                   Context context)
            throws AssertionException
Create a new object.

Parameters:
value - The value of the literal.
image - The string image of the literal.
Throws:
AssertionException - The exception raised if error during any validation.
Method Detail

getImage

public java.lang.String getImage()
Return the string image of the literal.


getValue

public java.lang.Long getValue()
Return the value of the literal.


hasPure

public boolean hasPure()
Return TRUE if the expression is, or has, a PURE clause; otherwise, return FALSE.

Specified by:
hasPure in class AssertionExpression

hasResult

public boolean hasResult()
Return TRUE if the expression contains RESULT; otherwise, return FALSE.

Specified by:
hasResult in class AssertionExpression

hasResultOrArg

public boolean hasResultOrArg()
Return TRUE if a result clause or method argument is found within the expression; otherwise, return FALSE.

Specified by:
hasResultOrArg in class AssertionExpression

hasResultOrOutArg

public boolean hasResultOrOutArg(boolean outOnly)
Return TRUE if a result clause or output argument is found within the expression; otherwise, return FALSE.

Specified by:
hasResultOrOutArg in class AssertionExpression
Parameters:
outOnly - TRUE if only concerned with output arguments that are out only; FALSE otherwise.

hasMethodCall

public boolean hasMethodCall()
Return TRUE if the expression is, or has, at least one method call; otherwise, return FALSE.

Specified by:
hasMethodCall in class AssertionExpression

getDefaultComplexity

public int getDefaultComplexity()
Return the default complexity of the expression (0 = constant, 1 = linear, etc.).

Specified by:
getDefaultComplexity in class AssertionExpression

hasBuiltinMethod

public boolean hasBuiltinMethod(int type)
Return TRUE if the expression is, or has, the specified built-in method call; otherwise, return FALSE.

Specified by:
hasBuiltinMethod in class AssertionExpression

hasUserDefinedMethod

public 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.

Specified by:
hasUserDefinedMethod in class AssertionExpression

requiresExtendableContext

public boolean requiresExtendableContext()
Return TRUE if extendable context is required to validate the expression; otherwise, return FALSE.

Specified by:
requiresExtendableContext in class AssertionExpression

requiresMethodContext

public boolean requiresMethodContext()
Return TRUE if method context is required to validate the expression; otherwise, return FALSE.

Specified by:
requiresMethodContext in class AssertionExpression

validateSemantics

protected void validateSemantics(Extendable ext,
                                 Method m)
                          throws AssertionException
Validate the expression semantics, if necessary, within the context of the extendable and optional method.

Specified by:
validateSemantics in class AssertionExpression
Parameters:
ext - The interface or class that owns this expression.
m - The method that owns this expression.
Throws:
AssertionException - The exception that can be raised during any validation.

getArrayIterMacros

public java.util.ArrayList getArrayIterMacros(java.lang.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.

Specified by:
getArrayIterMacros in class AssertionExpression

getNumArrayIterMacrosByType

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.

Specified by:
getNumArrayIterMacrosByType in class AssertionExpression

cExpression

public java.lang.String cExpression(java.lang.String epvVar,
                                    int[] startInd)
Return the C version of the expression.

Specified by:
cExpression in class AssertionExpression

toString

public java.lang.String toString()
Return the stringified version of the expression (in SIDL form).

Specified by:
toString in class AssertionExpression

accept

public java.lang.Object accept(ExprVisitor ev,
                               java.lang.Object data)
Implement the "visitor pattern".

Specified by:
accept in class AssertionExpression