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:
evaluate
in interfaceIExpression
- Overrides:
evaluate
in classExpression
-
toString
public String toString()
Description copied from class:Expression
Subclasses should return a String representing the parsed expression.- Specified by:
toString
in classExpression
-
setBody
public void setBody(IParsedElement blockBody)
-
getType
public IFunctionType getType()
Description copied from class:Expression
Returns this Expression's IType.- Specified by:
getType
in interfaceIHasType
- Overrides:
getType
in classExpression
-
getTypeImpl
public IFunctionType getTypeImpl()
- Overrides:
getTypeImpl
in classExpression
-
getBlockReturnType
public IType getBlockReturnType()
-
setBlockReturnType
public void setBlockReturnType(IType blockReturnType)
-
getBody
public IParsedElement getBody()
- Specified by:
getBody
in interfaceIBlockExpression
-
getArgs
public List<ISymbol> getArgs()
- Specified by:
getArgs
in interfaceIBlockExpression
-
getCapturedSymbol
public ICapturedSymbol getCapturedSymbol(String strName)
- Specified by:
getCapturedSymbol
in interfaceIBlockExpression
-
addCapturedSymbol
public void addCapturedSymbol(ICapturedSymbol sym)
-
isWithinScope
public boolean isWithinScope(ISymbol sym, ISymbolTable symbolTable)
- Specified by:
isWithinScope
in interfaceIBlockExpression
-
getFunctionName
public String getFunctionName()
- Specified by:
getFunctionName
in interfaceIParsedElement
- Overrides:
getFunctionName
in 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:
getScope
in interfaceIBlockExpression
-
shouldClearParseInfo
public boolean shouldClearParseInfo()
- Overrides:
shouldClearParseInfo
in classParsedElement
-
setBlockGosuClass
public void setBlockGosuClass(IBlockClassInternal blockClass)
-
getBlockGosuClass
public IBlockClass getBlockGosuClass()
- Specified by:
getBlockGosuClass
in interfaceIBlockExpression
-
getGosuClass
public IGosuClass getGosuClass()
- Specified by:
getGosuClass
in interfaceIParsedElement
- Overrides:
getGosuClass
in classParsedElement
-
getCapturedSymbols
public Map<String,ICapturedSymbol> getCapturedSymbols()
-
updateGosuClass
public void updateGosuClass()
-
-