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.protectedDynamicFunctionSymbol(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:
renameAsErrantDuplicatein classSymbol
-
getDisplayName
public String getDisplayName()
Description copied from class:SymbolReturns the Symbol's optional display name. If a display name is not assigned, returns the symbol's name.- Specified by:
getDisplayNamein interfaceIReducedSymbol- Specified by:
getDisplayNamein interfaceISymbol- Overrides:
getDisplayNamein classSymbol
-
setDisplayName
protected void setDisplayName(String strDisplayName)
-
getArgs
public List<ISymbol> getArgs()
- Specified by:
getArgsin interfaceIDynamicFunctionSymbol- Returns:
- The Symbols for the arguments to this function.
-
getArgTypes
public IType[] getArgTypes()
- Specified by:
getArgTypesin interfaceIDynamicFunctionSymbol
-
getReturnType
public IType getReturnType()
- Specified by:
getReturnTypein interfaceIDynamicFunctionSymbol
-
invoke
public Object invoke(Object[] args)
Invokes the dynamic function.- Specified by:
invokein interfaceIFunctionSymbol- Overrides:
invokein classSymbol
-
getCannonicalName
protected String getCannonicalName()
- Returns:
- the canonical, generic name of this function
-
isClassMember
public boolean isClassMember()
- Overrides:
isClassMemberin classSymbol
-
clearDebugInfo
public void clearDebugInfo()
- Overrides:
clearDebugInfoin classAbstractDynamicSymbol
-
isReified
public boolean isReified()
- Specified by:
isReifiedin interfaceIReducedSymbol- Overrides:
isReifiedin classSymbol
-
isConstructor
public boolean isConstructor()
- Specified by:
isConstructorin interfaceIDynamicFunctionSymbol
-
getSignatureDescription
public String getSignatureDescription()
- Specified by:
getSignatureDescriptionin interfaceIFunctionSymbol- Overrides:
getSignatureDescriptionin classSymbol
-
getLightWeightReference
public ISymbol getLightWeightReference()
- Specified by:
getLightWeightReferencein interfaceISymbol- Specified by:
getLightWeightReferencein classAbstractDynamicSymbol
-
getMethodSignature
public String getMethodSignature()
- Specified by:
getMethodSignaturein 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:
getParameterDisplayin interfaceIDynamicFunctionSymbol
-
getFunctionSymbol
protected DynamicFunctionSymbol getFunctionSymbol()
-
setInitializer
public void setInitializer(MethodCallStatement initializer)
-
getInitializer
public MethodCallStatement getInitializer()
- Specified by:
getInitializerin interfaceIDynamicFunctionSymbol
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstractin interfaceIReducedSymbol- Overrides:
isAbstractin classSymbol
-
setAbstract
public void setAbstract(boolean bAbstract)
- Overrides:
setAbstractin classSymbol
-
isFinal
public boolean isFinal()
- Specified by:
isFinalin interfaceIReducedSymbol- Overrides:
isFinalin classSymbol
-
getBackingDfs
public IDynamicFunctionSymbol getBackingDfs()
- Specified by:
getBackingDfsin interfaceIDynamicFunctionSymbol
-
getMethodOrConstructorInfo
public IAttributedFeatureInfo getMethodOrConstructorInfo(boolean acceptNone)
- Specified by:
getMethodOrConstructorInfoin interfaceIDynamicFunctionSymbol
-
getMethodOrConstructorInfo
public IAttributedFeatureInfo getMethodOrConstructorInfo()
- Specified by:
getMethodOrConstructorInfoin interfaceIDynamicFunctionSymbol
-
getDeclaringTypeInfo
public ITypeInfo getDeclaringTypeInfo()
- Specified by:
getDeclaringTypeInfoin interfaceIDynamicFunctionSymbol
-
getFullDescription
public String getFullDescription()
- Specified by:
getFullDescriptionin interfaceIReducedSymbol- Overrides:
getFullDescriptionin classSymbol
-
setValue
public void setValue(Object value)
Description copied from class:SymbolAssigns a value to this Symbol.
-
getDeclFunctionStmt
public FunctionStatement getDeclFunctionStmt()
- Specified by:
getDeclFunctionStmtin interfaceIDynamicFunctionSymbol
-
setDeclFunctionStmt
public void setDeclFunctionStmt(FunctionStatement declFunctionStmt)
-
getParameterizedVersion
public DynamicFunctionSymbol getParameterizedVersion(IGosuClass gsClass)
- Specified by:
getParameterizedVersionin 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:
getSuperDfsin interfaceIDynamicFunctionSymbol
-
hasTypeVariables
public boolean hasTypeVariables()
- Specified by:
hasTypeVariablesin interfaceIReducedSymbol- Overrides:
hasTypeVariablesin classAbstractDynamicSymbol
-
hasOptionalParameters
public boolean hasOptionalParameters()
-
createReducedSymbol
public IReducedDynamicFunctionSymbol createReducedSymbol()
- Specified by:
createReducedSymbolin interfaceIDynamicFunctionSymbol- Specified by:
createReducedSymbolin interfaceISymbol- Overrides:
createReducedSymbolin classSymbol
-
setLoopImplicitReturn
public void setLoopImplicitReturn(boolean bLoopImplicitReturn)
-
isLoopImplicitReturn
public boolean isLoopImplicitReturn()
-
getAnnotationDefault
public IExpression getAnnotationDefault()
-
setAnnotationDefault
public void setAnnotationDefault(IExpression annotationDefault)
-
-