Package gw.internal.gosu.parser
Class DynamicFunctionSymbol
- java.lang.Object
-
- gw.internal.gosu.parser.Symbol
-
- gw.internal.gosu.parser.AbstractDynamicSymbol
-
- gw.internal.gosu.parser.DynamicFunctionSymbol
-
- All Implemented Interfaces:
IDynamicFunctionSymbol
,IDynamicSymbol
,IFunctionSymbol
,IHasType
,IReducedSymbol
,ISymbol
- Direct Known Subclasses:
DelegateFunctionSymbol
,EnhancementDynamicFunctionSymbol
,EnumAllValuesFunctionSymbol
,EnumCodeFunctionSymbol
,EnumDisplayNameFunctionSymbol
,EnumNameFunctionSymbol
,EnumOrdinalFunctionSymbol
,EnumValueFunctionSymbol
,EnumValueOfFunctionSymbol
,EnumValuesFunctionSymbol
,GosuObjectFunctionSymbol
,InitConstructorFunctionSymbol
,IntrinsicTypeFunctionSymbol
,OuterFunctionSymbol
,ParameterizedDynamicFunctionSymbol
,ProgramClassFunctionSymbol
,ProgramExecuteFunctionSymbol
,SuperConstructorFunctionSymbol
,TemplateRenderFunctionSymbol
,ThisConstructorFunctionSymbol
,VarPropertyGetFunctionSymbol
,VarPropertySetFunctionSymbol
public class DynamicFunctionSymbol extends AbstractDynamicSymbol implements IDynamicFunctionSymbol
Represents a parsed function as specified in the Gosu spec.
-
-
Field Summary
-
Fields inherited from class gw.internal.gosu.parser.AbstractDynamicSymbol
_scriptPartId, _symTable
-
Fields inherited from class gw.internal.gosu.parser.Symbol
_bGlobal, _iIndex, _stackProvider, _symbolTable, _value, MEMBER_STACK_PROVIDER
-
-
Constructor Summary
Constructors Modifier Constructor Description DynamicFunctionSymbol(DynamicFunctionSymbol dfs)
DynamicFunctionSymbol(ISymbolTable symTable, CharSequence strName, IFunctionType type, List<ISymbol> args, IExpression value)
Constructs a DynamicFunctionSymbol for use with an IGosuParser's ISymbolTable.DynamicFunctionSymbol(ISymbolTable symTable, CharSequence strName, IFunctionType type, List<ISymbol> args, IStatement value)
Constructs a DynamicFunctionSymbol for use with an IGosuParser's ISymbolTable.protected
DynamicFunctionSymbol(ISymbolTable symTable, CharSequence name, IFunctionType type, List<ISymbol> args, Object value)
-
Method Summary
-
Methods inherited from class gw.internal.gosu.parser.AbstractDynamicSymbol
assignIndex, getGosuClass, getScriptPart, getSymbolTable, hasDynamicSymbolTable, isFromJava, isLocal, setDynamicSymbolTable, setScriptPart
-
Methods inherited from class gw.internal.gosu.parser.Symbol
assignIndexInStack, canBeCaptured, getAnnotations, getDefaultValueExpression, getDynamicSymbolTable, getIndex, getModifierInfo, getModifiers, getName, getSymbolClass, getType, getValue, getValueDirectly, isHide, isImplicitlyInitialized, isInternal, isOverride, isPrivate, isProtected, isPublic, isStackSymbol, isStatic, isValueBoxed, isWritable, makeCapturedSymbol, replaceModifierInfo, setClassMember, setDefaultValueExpression, setHide, setIndex, setInternal, setModifierInfo, setModifiers, setName, setOverride, setPrivate, setProtected, setPublic, setReified, setStatic, setType, setValueDirectly, setValueIsBoxed, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gw.lang.parser.IDynamicFunctionSymbol
getValueDirectly, isOverride, isStatic
-
Methods inherited from interface gw.lang.parser.IDynamicSymbol
getGosuClass, getScriptPart
-
Methods inherited from interface gw.lang.parser.IFunctionSymbol
getModifiers, isFromJava, isStackSymbol
-
Methods inherited from interface gw.lang.parser.IReducedSymbol
getAnnotations, getSymbolClass, getType, isInternal, isPrivate, isProtected, isPublic
-
Methods inherited from interface gw.lang.parser.ISymbol
canBeCaptured, getDefaultValueExpression, getDynamicSymbolTable, getIndex, getModifierInfo, getName, getType, getValue, hasDynamicSymbolTable, isLocal, isValueBoxed, isWritable, makeCapturedSymbol, setDefaultValueExpression, setDynamicSymbolTable, setType, setValueIsBoxed
-
-
-
-
Constructor Detail
-
DynamicFunctionSymbol
public DynamicFunctionSymbol(ISymbolTable symTable, CharSequence strName, IFunctionType type, List<ISymbol> args, IStatement value)
Constructs a DynamicFunctionSymbol for use with an IGosuParser's ISymbolTable.- Parameters:
symTable
- The symbol table.strName
- The symbol name.type
- The IGosuParser specific type.args
- The symbols for the function's arguments (or null).value
- A statement for the body of the function (or null).
-
DynamicFunctionSymbol
public DynamicFunctionSymbol(ISymbolTable symTable, CharSequence strName, IFunctionType type, List<ISymbol> args, IExpression value)
Constructs a DynamicFunctionSymbol for use with an IGosuParser's ISymbolTable.- Parameters:
symTable
- The symbol table.strName
- The symbol name.type
- The IGosuParser specific type.args
- The symbols for the function's arguments (or null).value
- An expression for the body of the function (or null).
-
DynamicFunctionSymbol
protected DynamicFunctionSymbol(ISymbolTable symTable, CharSequence name, IFunctionType type, List<ISymbol> args, Object value)
-
DynamicFunctionSymbol
public DynamicFunctionSymbol(DynamicFunctionSymbol dfs)
-
-
Method Detail
-
renameAsErrantDuplicate
public void renameAsErrantDuplicate(int iIndex)
- Overrides:
renameAsErrantDuplicate
in classSymbol
-
getDisplayName
public String getDisplayName()
Description copied from class:Symbol
Returns the Symbol's optional display name. If a display name is not assigned, returns the symbol's name.- Specified by:
getDisplayName
in interfaceIReducedSymbol
- Specified by:
getDisplayName
in interfaceISymbol
- Overrides:
getDisplayName
in classSymbol
-
setDisplayName
protected void setDisplayName(String strDisplayName)
-
getArgs
public List<ISymbol> getArgs()
- Specified by:
getArgs
in interfaceIDynamicFunctionSymbol
- Returns:
- The Symbols for the arguments to this function.
-
getArgTypes
public IType[] getArgTypes()
- Specified by:
getArgTypes
in interfaceIDynamicFunctionSymbol
-
getReturnType
public IType getReturnType()
- Specified by:
getReturnType
in interfaceIDynamicFunctionSymbol
-
invoke
public Object invoke(Object[] args)
Invokes the dynamic function.- Specified by:
invoke
in interfaceIFunctionSymbol
- Overrides:
invoke
in classSymbol
-
getCannonicalName
protected String getCannonicalName()
- Returns:
- the canonical, generic name of this function
-
isClassMember
public boolean isClassMember()
- Overrides:
isClassMember
in classSymbol
-
clearDebugInfo
public void clearDebugInfo()
- Overrides:
clearDebugInfo
in classAbstractDynamicSymbol
-
isReified
public boolean isReified()
- Specified by:
isReified
in interfaceIReducedSymbol
- Overrides:
isReified
in classSymbol
-
isConstructor
public boolean isConstructor()
- Specified by:
isConstructor
in interfaceIDynamicFunctionSymbol
-
getSignatureDescription
public String getSignatureDescription()
- Specified by:
getSignatureDescription
in interfaceIFunctionSymbol
- Overrides:
getSignatureDescription
in classSymbol
-
getLightWeightReference
public ISymbol getLightWeightReference()
- Specified by:
getLightWeightReference
in interfaceISymbol
- Specified by:
getLightWeightReference
in classAbstractDynamicSymbol
-
getMethodSignature
public String getMethodSignature()
- Specified by:
getMethodSignature
in interfaceIDynamicFunctionSymbol
-
getSignatureName
public static String getSignatureName(CharSequence strName, List<ISymbol> args)
-
getSignatureName
protected String getSignatureName(CharSequence strName)
-
getParameterDisplay
public String getParameterDisplay(boolean bRelative)
- Specified by:
getParameterDisplay
in interfaceIDynamicFunctionSymbol
-
getFunctionSymbol
protected DynamicFunctionSymbol getFunctionSymbol()
-
setInitializer
public void setInitializer(MethodCallStatement initializer)
-
getInitializer
public MethodCallStatement getInitializer()
- Specified by:
getInitializer
in interfaceIDynamicFunctionSymbol
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstract
in interfaceIReducedSymbol
- Overrides:
isAbstract
in classSymbol
-
setAbstract
public void setAbstract(boolean bAbstract)
- Overrides:
setAbstract
in classSymbol
-
isFinal
public boolean isFinal()
- Specified by:
isFinal
in interfaceIReducedSymbol
- Overrides:
isFinal
in classSymbol
-
getBackingDfs
public IDynamicFunctionSymbol getBackingDfs()
- Specified by:
getBackingDfs
in interfaceIDynamicFunctionSymbol
-
getMethodOrConstructorInfo
public IAttributedFeatureInfo getMethodOrConstructorInfo(boolean acceptNone)
- Specified by:
getMethodOrConstructorInfo
in interfaceIDynamicFunctionSymbol
-
getMethodOrConstructorInfo
public IAttributedFeatureInfo getMethodOrConstructorInfo()
- Specified by:
getMethodOrConstructorInfo
in interfaceIDynamicFunctionSymbol
-
getDeclaringTypeInfo
public ITypeInfo getDeclaringTypeInfo()
- Specified by:
getDeclaringTypeInfo
in interfaceIDynamicFunctionSymbol
-
getFullDescription
public String getFullDescription()
- Specified by:
getFullDescription
in interfaceIReducedSymbol
- Overrides:
getFullDescription
in classSymbol
-
setValue
public void setValue(Object value)
Description copied from class:Symbol
Assigns a value to this Symbol.
-
getDeclFunctionStmt
public FunctionStatement getDeclFunctionStmt()
- Specified by:
getDeclFunctionStmt
in interfaceIDynamicFunctionSymbol
-
setDeclFunctionStmt
public void setDeclFunctionStmt(FunctionStatement declFunctionStmt)
-
getParameterizedVersion
public DynamicFunctionSymbol getParameterizedVersion(IGosuClass gsClass)
- Specified by:
getParameterizedVersion
in classAbstractDynamicSymbol
-
clearDefn
public void clearDefn()
Used to remove definition compiled info from this class.
-
setSuperDfs
public void setSuperDfs(DynamicFunctionSymbol superDfs)
-
getSuperDfs
public DynamicFunctionSymbol getSuperDfs()
- Specified by:
getSuperDfs
in interfaceIDynamicFunctionSymbol
-
hasTypeVariables
public boolean hasTypeVariables()
- Specified by:
hasTypeVariables
in interfaceIReducedSymbol
- Overrides:
hasTypeVariables
in classAbstractDynamicSymbol
-
hasOptionalParameters
public boolean hasOptionalParameters()
-
createReducedSymbol
public IReducedDynamicFunctionSymbol createReducedSymbol()
- Specified by:
createReducedSymbol
in interfaceIDynamicFunctionSymbol
- Specified by:
createReducedSymbol
in interfaceISymbol
- Overrides:
createReducedSymbol
in classSymbol
-
setLoopImplicitReturn
public void setLoopImplicitReturn(boolean bLoopImplicitReturn)
-
isLoopImplicitReturn
public boolean isLoopImplicitReturn()
-
getAnnotationDefault
public IExpression getAnnotationDefault()
-
setAnnotationDefault
public void setAnnotationDefault(IExpression annotationDefault)
-
-