com.togethersoft.sca.ast
Interface AstExpression

All Superinterfaces:
AstObject
All Known Subinterfaces:
AstArrayCreationExpression, AstArrayInitializer, AstArrayReference, AstAssignmentExpression, AstBinaryExpression, AstBooleanLiteral, AstCastExpression, AstCharLiteral, AstConditionalExpression, AstConstructorInvocation, AstDbcResult, AstDoubleLiteral, AstFieldReference, AstFloatLiteral, AstIntLiteral, AstLiteral, AstLongLiteral, AstMethodCallExpression, AstNullLiteral, AstObjectCreationExpression, AstParenthesizedExpression, AstSimpleReference, AstStringLiteral, AstSuperExpression, AstThisExpression, AstTypeExpression, AstUnaryExpression

public interface AstExpression
extends AstObject

The common interface for expressions.


Fields inherited from interface com.togethersoft.sca.ast.AstObject
ARRAY_CREATION, ARRAY_INITIALIZER, ARRAY_REFERENCE, ASSERT_STATEMENT, ASSIGNMENT_EXPRESSION, BINARY_EXPRESSION, BREAK_STATEMENT, CASE_LABEL, CAST_EXPRESSION, CATCH_CLAUSE, CLASS_FILE, COMMENT, COMPILATION_UNIT, COMPOUND_STATEMENT, CONDITIONAL_EXPRESSION, CONSTRUCTOR_INVOCATION, CONTINUE_STATEMENT, DBC_RESULT, DECLARATION_STATEMENT, DO_STATEMENT, EMPTY_STATEMENT, EXPRESSION_STATEMENT, FIELD_REFERENCE, FINALLY_CLAUSE, FOR_STATEMENT, IF_STATEMENT, IMPORT, INITIALIZER, JAVADOC_TAG, LITERAL, METHOD, METHOD_CALL_EXPRESSION, N_A, OBJECT_CREATION_EXPRESSION, PACKAGE, PARENTHESIZED_EXPRESSION, RETURN_STATEMENT, SIMPLE_REFERENCE, SUPER_EXPRESSION, SWITCH_GROUP, SWITCH_STATEMENT, SYNCHRONIZED_STATEMENT, THIS_EXPRESSION, THROW_SPECIFIER, THROW_STATEMENT, TRY_STATEMENT, TYPE, TYPE_EXPRESSION, UNARY_EXPRESSION, VARIABLE, VARIABLE_DECLARATION, WHILE_STATEMENT
 
Method Summary
 AstExpression[] getOperands()
          Returns the operands of this expression.
 AstTypeReference getRuntimeType()
          Returns the runtime time of this expression.
 AstTypeReference getType()
          Returns the type of this expression.
 boolean isConstant()
          Returns true if this is a compile-time constant expression.
 
Methods inherited from interface com.togethersoft.sca.ast.AstObject
addComment, getChildren, getComments, getCompilationUnit, getDeclaringMethod, getDeclaringType, getObjectKind, getPackage, getParent, getPosition, isDeleted, remove, replaceWith, replaceWith, setPosition, setPositionAfter, visitExpressions, visitStatements
 

Method Detail

getOperands

public AstExpression[] getOperands()
Returns the operands of this expression. Returns an empty array if this expression has no operands.
Returns:
the expression's operands.

getRuntimeType

public AstTypeReference getRuntimeType()
Returns the runtime time of this expression. The runtime type may differ from the type known at compile time if compiler has to insert a type cast, for instance, for type promotion.
Returns:
the expression's runtime type.

getType

public AstTypeReference getType()
Returns the type of this expression.
Returns:
the expression's type.

isConstant

public boolean isConstant()
Returns true if this is a compile-time constant expression. For definition of compile-time constant expressions see JLS Section 5.28.
Returns:
true if this is a constant.