Package gw.internal.gosu.parser
Class Expression
java.lang.Object
gw.internal.gosu.parser.ParsedElement
gw.internal.gosu.parser.Expression
- All Implemented Interfaces:
IExpression
,IHasType
,IParsedElement
- Direct Known Subclasses:
AnnotationUseSiteTargetClause
,ArgumentListClause
,ArithmeticExpression
,ArrayAccess
,BadInitializerExpression
,BeanMethodCallExpression
,BinaryExpression
,BindingExpression
,BlockExpression
,BlockInvocation
,CaseClause
,ClassDeclaration
,CollectionInitializerExpression
,ConditionalTernaryExpression
,DefaultArgLiteral
,DirectiveExpression
,EvalExpression
,FeatureLiteral
,Identifier
,InterfacesClause
,Literal
,LocalVarDeclaration
,MapAccess
,MapInitializerExpression
,MemberAccess
,MethodCallExpression
,ModifierListClause
,NameInDeclaration
,NewExpression
,ObjectInitializerExpression
,ParameterListClause
,ParenthesizedExpression
,Program
,StaticTypeOfExpression
,SuperAccess
,SuperTypeClause
,TemplateStringLiteral
,TypeAsExpression
,TypeIsExpression
,TypeOfExpression
,TypeParameterListClause
,TypeVariableDefinition
,TypeVariableListClause
,UnaryExpression
,UnaryNotPlusMinusExpression
The root class for all Expressions represented in a parse tree as specified
in the Gosu grammar.
- See Also:
-
Field Summary
FieldsFields inherited from class gw.internal.gosu.parser.ParsedElement
_tokens, UNDEF_FILE, UNDEF_FUNCTION, UNDEF_MODULE
Fields inherited from interface gw.lang.parser.IExpression
EMPTY_ARRAY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionevaluate()
Evaluates this Expression and returns the result.evaluate
(IExternalSymbolMap externalSymbols) Context type is the type this literal value evaluates as in the context of a containing expression e.g., given the expression, n == "42", the literal "42" is always converted to a Number.getType()
Returns this Expression's IType.protected IType
boolean
boolean
void
Sets this Expression's IType.abstract String
toString()
Subclasses should return a String representing the parsed expression.Methods inherited from class gw.internal.gosu.parser.ParsedElement
addExceptionsFrom, addParseException, addParseException, addParseException, addParseExceptions, addParseIssues, addParseWarning, addParseWarning, addParseWarnings, addToken, adjustColumn, adjustLineNum, assignTokens, clearParseExceptions, clearParseTreeInformation, clearParseWarnings, compactParseTree, findAncestorParsedElementByType, findDeclaringStatement, findLineNumberOfDeclaration, findRootParsedElement, getAnnotations, getColumn, getContainedParsedElementsByType, getContainedParsedElementsByTypes, getContainedParsedElementsByTypesWithIgnoreSet, getEnclosingFeatureInfo, getFunctionName, getGosuClass, getGosuProgram, getImmediateParseIssue, getImmediateParseIssues, getLineNum, getLocation, getModule, getParent, getParseExceptions, getParseIssues, getParseWarnings, getQualifyingEnclosingTypeInfo, getTokens, hasImmediateParseIssue, hasImmediateParseWarning, hasImmediateParseWarnings, hasParseException, hasParseExceptions, hasParseIssue, hasParseIssues, hasParseWarning, hasParseWarnings, initEmptyParseTree, initLocation, isCompileTimeConstant, isSuppressed, isSuppressed, isSynthetic, makeDoubleValue, makeFloatValue, makeInteger, makeLong, removeParseException, removeParseWarning, removeParseWarningRecursively, setGosuProgram, setLineNum, setLocation, setParent, setSynthetic, shouldClearParseInfo, visit
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface gw.lang.parser.IParsedElement
addExceptionsFrom, addParseException, addParseException, addParseWarning, addParseWarning, clearParseExceptions, clearParseTreeInformation, clearParseWarnings, findAncestorParsedElementByType, findDeclaringStatement, findRootParsedElement, getColumn, getContainedParsedElementsByType, getContainedParsedElementsByTypes, getContainedParsedElementsByTypesWithIgnoreSet, getFunctionName, getGosuClass, getGosuProgram, getImmediateParseIssue, getImmediateParseIssues, getLineNum, getLocation, getModule, getParent, getParseExceptions, getParseIssues, getParseWarnings, getTokens, hasImmediateParseIssue, hasImmediateParseWarnings, hasParseException, hasParseExceptions, hasParseIssue, hasParseIssues, hasParseWarning, hasParseWarnings, isCompileTimeConstant, isSuppressed, isSynthetic, setLocation, setParent, visit
-
Field Details
-
_type
-
-
Constructor Details
-
Expression
public Expression()
-
-
Method Details
-
getType
Returns this Expression's IType. -
getTypeImpl
-
setType
Sets this Expression's IType. -
isNullSafe
public boolean isNullSafe()- Specified by:
isNullSafe
in interfaceIExpression
-
isUnchecked
public boolean isUnchecked()- Specified by:
isUnchecked
in interfaceIExpression
-
evaluate
Description copied from interface:IExpression
Evaluates this Expression and returns the result.- Specified by:
evaluate
in interfaceIExpression
-
evaluate
- Specified by:
evaluate
in interfaceIExpression
-
getReturnType
- Specified by:
getReturnType
in interfaceIParsedElement
-
getContextType
Context type is the type this literal value evaluates as in the context of a containing expression e.g., given the expression, n == "42", the literal "42" is always converted to a Number. This feature is most useful for source code tools that provide source-sensitive help (e.g., rule composer).- Specified by:
getContextType
in interfaceIExpression
-
toString
Subclasses should return a String representing the parsed expression.
-