public final class TypeExpression extends Expression
Constructor and Description |
---|
TypeExpression(ASTInfo info,
Type type,
int typeStartIndex,
int typeEndIndex) |
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.
|
Object |
getParseTimeConstant()
Returns the value of the expression determined in parse time.
|
TypeType |
getType()
Returns the return type.
|
int |
getTypeEndIndex()
Returns the end index of the type literal.
|
ASTNode |
getTypeRange() |
int |
getTypeStartIndex()
Returns the start index of the type literal.
|
String |
getTypeText()
Returns the type literal text.
|
boolean |
hasTypeKeyword()
Returns
true , if the expression has "type" keyword,
e.g. |
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, toExpressions
getFullText, getLine, getNodeText, getText, toString
contains, getBeginIndex, getEndIndex, getLength
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFullText, getLine, getNodeText, getText
contains, getBeginIndex, getEndIndex, getLength
public TypeType getType()
Expression
getType
in class Expression
public boolean isParseTimeConstant()
Expression
true
if the value of the expression is known
in parse time. E.g. constant literals, enumerations, types (without free types).isParseTimeConstant
in class Expression
true
if the expression value is known during parsingExpression.getParseTimeConstant()
public Object getParseTimeConstant()
Expression
UnsupportedOperationException
.
Subclasses, which return true
when Expression.isParseTimeConstant()
is called, should override this method.getParseTimeConstant
in class Expression
Expression.isParseTimeConstant()
public boolean hasTypeKeyword()
true
, if the expression has "type" keyword,
e.g. type(Person)
.true
, if the expression has "type" keywordpublic int getTypeStartIndex()
public int getTypeEndIndex()
public String getTypeText()
public ASTNode getTypeRange()
public <T,E extends Throwable> T accept(ExpressionVisitor<T,E> visitor) throws E extends Throwable
Expression
accept
in class Expression
E
E extends Throwable
protected Object basicInterpret(Interpreter interpreter, InterpreterStackTrace stackTrace)
Expression
basicInterpret
in class Expression
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.