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 IParsedElementprivate IBlockClassInternalprivate ITypeprivate Map<String,ICapturedSymbol> private StandardScopeFields inherited from class gw.internal.gosu.parser.Expression
_typeFields inherited from class gw.internal.gosu.parser.ParsedElement
_tokens, UNDEF_FILE, UNDEF_FUNCTION, UNDEF_MODULEFields inherited from interface gw.lang.parser.IExpression
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidevaluate()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.booleanisWithinScope(ISymbol sym, ISymbolTable symbolTable) voidvoidsetBlockGosuClass(IBlockClassInternal blockClass) voidsetBlockReturnType(IType blockReturnType) voidsetBody(IParsedElement blockBody) voidsetScope(StandardScope blockScope) The scope of the block, available only at compile timebooleantoString()Subclasses should return a String representing the parsed expression.voidMethods inherited from class gw.internal.gosu.parser.Expression
evaluate, getContextType, getReturnType, isNullSafe, isUnchecked, setTypeMethods 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, visitMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gw.lang.parser.IExpression
evaluate, getContextType, isNullSafe, isUncheckedMethods 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:IExpressionEvaluates this Expression and returns the result.- Specified by:
evaluatein interfaceIExpression- Overrides:
evaluatein classExpression
-
toString
Description copied from class:ExpressionSubclasses should return a String representing the parsed expression.- Specified by:
toStringin classExpression
-
setArgs
-
setBody
-
getType
Description copied from class:ExpressionReturns this Expression's IType.- Specified by:
getTypein interfaceIHasType- Overrides:
getTypein classExpression
-
getTypeImpl
- Overrides:
getTypeImplin classExpression
-
getBlockReturnType
-
setBlockReturnType
-
getBody
- Specified by:
getBodyin interfaceIBlockExpression
-
getArgs
- Specified by:
getArgsin interfaceIBlockExpression
-
getCapturedSymbol
- Specified by:
getCapturedSymbolin interfaceIBlockExpression
-
addCapturedSymbol
-
isWithinScope
- Specified by:
isWithinScopein interfaceIBlockExpression
-
getFunctionName
- Specified by:
getFunctionNamein interfaceIParsedElement- Overrides:
getFunctionNamein 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:
getScopein interfaceIBlockExpression
-
shouldClearParseInfo
public boolean shouldClearParseInfo()- Overrides:
shouldClearParseInfoin classParsedElement
-
setBlockGosuClass
-
getBlockGosuClass
- Specified by:
getBlockGosuClassin interfaceIBlockExpression
-
getGosuClass
- Specified by:
getGosuClassin interfaceIParsedElement- Overrides:
getGosuClassin classParsedElement
-
getCapturedSymbols
-
updateGosuClass
public void updateGosuClass()
-