public final class EnumerationExpression extends Expression
| Constructor and Description |
|---|
EnumerationExpression(ASTInfo info,
EnumerationType type,
String constant)
Constructs a new enumeration expression.
|
| Modifier and Type | Method and Description |
|---|---|
<T,E extends Throwable> |
accept(ExpressionVisitor<T,E> visitor)
Accepts visitor.
|
protected Object |
basicInterpret(Interpreter interpreter,
InterpreterStackTrace stackTrace)
Interpret expression.
|
String |
getConstant()
Returns the enumeration constant (literal).
|
ASTRange |
getConstantRange()
Returns the range of the constant.
|
Object |
getParseTimeConstant()
Returns the value of the expression determined in parse time.
|
EnumerationType |
getType()
Returns the return type.
|
ASTNode |
getTypeRange()
Returns the range of the enumeration type.
|
EnumerationImpl |
getValue()
Returns the enumeration value.
|
boolean |
isParseTimeConstant()
Returns
true if the value of the expression is known
in parse time. |
createANTLRParser, doInterpret, evalCondition, evaluateToExpressions, executeCompiled, getCompiled, getDebugLine, getIdentifierAst, getPrimaryRange, getPropertySelectorRange, getRange, getResultExpression, getResultExpressions, interpret, interpretInCurrentNamespace, isCreatingNonModuleContextObjects, requiresNewNamespace, setCompiled, showInFullText, showInSurroundingText, showInText, toExpressionsgetFullText, getLine, getNodeText, getText, toStringcontains, getBeginIndex, getEndIndex, getLengthclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFullText, getLine, getNodeText, getTextcontains, getBeginIndex, getEndIndex, getLengthpublic EnumerationExpression(ASTInfo info, EnumerationType type, String constant)
info - type - constant - an enumeration constantpublic String getConstant()
public EnumerationImpl getValue()
public boolean isParseTimeConstant()
Expressiontrue if the value of the expression is known
in parse time. E.g. constant literals, enumerations, types (without free types).isParseTimeConstant in class Expressiontrue if the expression value is known during parsingExpression.getParseTimeConstant()public Object getParseTimeConstant()
ExpressionUnsupportedOperationException.
Subclasses, which return true when Expression.isParseTimeConstant()
is called, should override this method.getParseTimeConstant in class ExpressionExpression.isParseTimeConstant()public EnumerationType getType()
ExpressiongetType in class Expressionpublic <T,E extends Throwable> T accept(ExpressionVisitor<T,E> visitor) throws E extends Throwable
Expressionaccept in class ExpressionEE extends Throwableprotected Object basicInterpret(Interpreter interpreter, InterpreterStackTrace stackTrace)
ExpressionbasicInterpret in class Expressionpublic ASTNode getTypeRange()
public ASTRange getConstantRange()
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.