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
public final class BlockExpression extends Expression implements IBlockExpression
A block expression, representing an anonymous function/closure- See Also:
IGosuParser
-
-
Field Summary
-
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 Constructor Description BlockExpression()Constructs an block expression.
-
Method Summary
-
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
-
-
-
-
Method Detail
-
evaluate
public Object evaluate()
- Specified by:
evaluatein interfaceIExpression- Overrides:
evaluatein classExpression
-
toString
public String toString()
Description copied from class:ExpressionSubclasses should return a String representing the parsed expression.- Specified by:
toStringin classExpression
-
setBody
public void setBody(IParsedElement blockBody)
-
getType
public IFunctionType getType()
Description copied from class:ExpressionReturns this Expression's IType.- Specified by:
getTypein interfaceIHasType- Overrides:
getTypein classExpression
-
getTypeImpl
public IFunctionType getTypeImpl()
- Overrides:
getTypeImplin classExpression
-
getBlockReturnType
public IType getBlockReturnType()
-
setBlockReturnType
public void setBlockReturnType(IType blockReturnType)
-
getBody
public IParsedElement getBody()
- Specified by:
getBodyin interfaceIBlockExpression
-
getArgs
public List<ISymbol> getArgs()
- Specified by:
getArgsin interfaceIBlockExpression
-
getCapturedSymbol
public ICapturedSymbol getCapturedSymbol(String strName)
- Specified by:
getCapturedSymbolin interfaceIBlockExpression
-
addCapturedSymbol
public void addCapturedSymbol(ICapturedSymbol sym)
-
isWithinScope
public boolean isWithinScope(ISymbol sym, ISymbolTable symbolTable)
- Specified by:
isWithinScopein interfaceIBlockExpression
-
getFunctionName
public String getFunctionName()
- Specified by:
getFunctionNamein interfaceIParsedElement- Overrides:
getFunctionNamein classParsedElement
-
setScope
public void setScope(StandardScope blockScope)
The scope of the block, available only at compile time
-
getScope
public IScope getScope()
The scope of the block, available only at compile time- Specified by:
getScopein interfaceIBlockExpression
-
shouldClearParseInfo
public boolean shouldClearParseInfo()
- Overrides:
shouldClearParseInfoin classParsedElement
-
setBlockGosuClass
public void setBlockGosuClass(IBlockClassInternal blockClass)
-
getBlockGosuClass
public IBlockClass getBlockGosuClass()
- Specified by:
getBlockGosuClassin interfaceIBlockExpression
-
getGosuClass
public IGosuClass getGosuClass()
- Specified by:
getGosuClassin interfaceIParsedElement- Overrides:
getGosuClassin classParsedElement
-
getCapturedSymbols
public Map<String,ICapturedSymbol> getCapturedSymbols()
-
updateGosuClass
public void updateGosuClass()
-
-