Class BlockExpression
java.lang.Object
gw.internal.gosu.parser.ParsedElement
gw.internal.gosu.parser.Expression
gw.internal.gosu.parser.expressions.BlockExpression
- All Implemented Interfaces:
IBlockExpression
,IExpression
,IHasType
,IParsedElement
A block expression, representing an anonymous function/closure
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IParsedElement
private IBlockClassInternal
private IType
private Map<String,
ICapturedSymbol> private StandardScope
Fields inherited from class gw.internal.gosu.parser.Expression
_type
Fields 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 TypeMethodDescriptionvoid
evaluate()
Evaluates this Expression and returns the result.getArgs()
getBody()
getCapturedSymbol
(String strName) getScope()
The scope of the block, available only at compile timegetType()
Returns this Expression's IType.boolean
isWithinScope
(ISymbol sym, ISymbolTable symbolTable) void
void
setBlockGosuClass
(IBlockClassInternal blockClass) void
setBlockReturnType
(IType blockReturnType) void
setBody
(IParsedElement blockBody) void
setScope
(StandardScope blockScope) The scope of the block, available only at compile timeboolean
toString()
Subclasses should return a String representing the parsed expression.void
Methods inherited from class gw.internal.gosu.parser.Expression
evaluate, getContextType, getReturnType, isNullSafe, isUnchecked, setType
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, 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, 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.IExpression
evaluate, getContextType, isNullSafe, isUnchecked
Methods inherited from interface gw.lang.parser.IParsedElement
addExceptionsFrom, addParseException, addParseException, addParseWarning, addParseWarning, clearParseExceptions, clearParseTreeInformation, clearParseWarnings, findAncestorParsedElementByType, findDeclaringStatement, findRootParsedElement, getColumn, getContainedParsedElementsByType, getContainedParsedElementsByTypes, getContainedParsedElementsByTypesWithIgnoreSet, getGosuProgram, getImmediateParseIssue, getImmediateParseIssues, getLineNum, getLocation, getModule, getParent, getParseExceptions, getParseIssues, getParseWarnings, getReturnType, getTokens, hasImmediateParseIssue, hasImmediateParseWarnings, hasParseException, hasParseExceptions, hasParseIssue, hasParseIssues, hasParseWarning, hasParseWarnings, isCompileTimeConstant, isSuppressed, isSynthetic, setLocation, setParent, visit
-
Field Details
-
_args
-
_blockBody
-
_capturedSymbols
-
_scope
-
_blockReturnType
-
_blockClass
-
-
Constructor Details
-
BlockExpression
public BlockExpression()Constructs an block expression.
-
-
Method Details
-
evaluate
Description copied from interface:IExpression
Evaluates this Expression and returns the result.- Specified by:
evaluate
in interfaceIExpression
- Overrides:
evaluate
in classExpression
-
toString
Description copied from class:Expression
Subclasses should return a String representing the parsed expression.- Specified by:
toString
in classExpression
-
setArgs
-
setBody
-
getType
Description copied from class:Expression
Returns this Expression's IType.- Specified by:
getType
in interfaceIHasType
- Overrides:
getType
in classExpression
-
getTypeImpl
- Overrides:
getTypeImpl
in classExpression
-
getBlockReturnType
-
setBlockReturnType
-
getBody
- Specified by:
getBody
in interfaceIBlockExpression
-
getArgs
- Specified by:
getArgs
in interfaceIBlockExpression
-
getCapturedSymbol
- Specified by:
getCapturedSymbol
in interfaceIBlockExpression
-
addCapturedSymbol
-
isWithinScope
- Specified by:
isWithinScope
in interfaceIBlockExpression
-
getFunctionName
- Specified by:
getFunctionName
in interfaceIParsedElement
- Overrides:
getFunctionName
in classParsedElement
-
setScope
The scope of the block, available only at compile time -
getScope
The scope of the block, available only at compile time- Specified by:
getScope
in interfaceIBlockExpression
-
shouldClearParseInfo
public boolean shouldClearParseInfo()- Overrides:
shouldClearParseInfo
in classParsedElement
-
setBlockGosuClass
-
getBlockGosuClass
- Specified by:
getBlockGosuClass
in interfaceIBlockExpression
-
getGosuClass
- Specified by:
getGosuClass
in interfaceIParsedElement
- Overrides:
getGosuClass
in classParsedElement
-
getCapturedSymbols
-
updateGosuClass
public void updateGosuClass()
-