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
Represents a parsed function as specified in the Gosu spec.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IExpression
private boolean
private FunctionStatement
private MethodCallStatement
private Object
private String
private DynamicFunctionSymbol
private static final Object
private static final Object
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
ConstructorsModifierConstructorDescriptionDynamicFunctionSymbol
(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
Modifier and TypeMethodDescriptionvoid
void
Used to remove definition compiled info from this class.private void
boolean
private IGosuClass
getArgs()
IType[]
protected String
Returns the Symbol's optional display name.protected DynamicFunctionSymbol
Creates a copy of this symbol without the value so that the empty symbol can be stored.getMethodOrConstructorInfo
(boolean acceptNone) getParameterDisplay
(boolean bRelative) getParameterizedVersion
(IGosuClass gsClass) Returns a description of arguments of the form ( < argName1 >, < argName2 >, etc.protected String
getSignatureName
(CharSequence strName) static String
getSignatureName
(CharSequence strName, List<ISymbol> args) private static String
int
hashCode()
boolean
boolean
Invokes the dynamic function.private Object
invokeFromBytecode
(Object[] args) boolean
boolean
boolean
boolean
isFinal()
boolean
boolean
void
renameAsErrantDuplicate
(int iIndex) void
setAbstract
(boolean bAbstract) void
setAnnotationDefault
(IExpression annotationDefault) void
void
setDeclFunctionStmt
(FunctionStatement declFunctionStmt) protected void
setDisplayName
(String strDisplayName) void
setFinal
(boolean bFinal) void
setInitializer
(MethodCallStatement initializer) void
setLoopImplicitReturn
(boolean bLoopImplicitReturn) void
setSuperDfs
(DynamicFunctionSymbol superDfs) void
Assigns a value to this Symbol.Methods inherited from class gw.internal.gosu.parser.AbstractDynamicSymbol
assignIndex, getCompiledStatementDirectly, 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
-
Field Details
-
DEFINITION_CLEARED
-
NULL_MI
-
_strDisplayName
-
_args
-
_initializer
-
_functionStmt
-
_superDfs
-
_bLoopImplicitReturn
private boolean _bLoopImplicitReturn -
_annotationDefault
-
_mi
-
-
Constructor Details
-
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
-
-
Method Details
-
renameAsErrantDuplicate
public void renameAsErrantDuplicate(int iIndex) - Overrides:
renameAsErrantDuplicate
in classSymbol
-
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
-
getArgs
- Specified by:
getArgs
in interfaceIDynamicFunctionSymbol
- Returns:
- The Symbols for the arguments to this function.
-
getArgTypes
- Specified by:
getArgTypes
in interfaceIDynamicFunctionSymbol
-
getReturnType
- Specified by:
getReturnType
in interfaceIDynamicFunctionSymbol
-
invoke
Invokes the dynamic function.- Specified by:
invoke
in interfaceIFunctionSymbol
- Overrides:
invoke
in classSymbol
- Parameters:
args
- An array of arguments to forward to the function.
-
invokeFromBytecode
-
ensureDeclaringClassIsCompiled
private void ensureDeclaringClassIsCompiled() -
findGosuClassOrProgram
-
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
Description copied from interface:IFunctionSymbol
Returns a description of arguments of the form ( < argName1 >, < argName2 >, etc. ) appropriate for display in a source editor ui.- Specified by:
getSignatureDescription
in interfaceIFunctionSymbol
- Overrides:
getSignatureDescription
in classSymbol
-
getLightWeightReference
Description copied from interface:ISymbol
Creates a copy of this symbol without the value so that the empty symbol can be stored.- Specified by:
getLightWeightReference
in interfaceISymbol
- Specified by:
getLightWeightReference
in classAbstractDynamicSymbol
-
getMethodSignature
- Specified by:
getMethodSignature
in interfaceIDynamicFunctionSymbol
-
getSignatureName
-
getSignatureName
-
getParameterDisplay
- Specified by:
getParameterDisplay
in interfaceIDynamicFunctionSymbol
-
getUniqueNameForParameters
-
getFunctionSymbol
-
setInitializer
-
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
-
setFinal
public void setFinal(boolean bFinal) -
getBackingDfs
- Specified by:
getBackingDfs
in interfaceIDynamicFunctionSymbol
-
getMethodOrConstructorInfo
- Specified by:
getMethodOrConstructorInfo
in interfaceIDynamicFunctionSymbol
-
getMethodOrConstructorInfo
- Specified by:
getMethodOrConstructorInfo
in interfaceIDynamicFunctionSymbol
-
getDeclaringTypeInfo
- Specified by:
getDeclaringTypeInfo
in interfaceIDynamicFunctionSymbol
-
getFullDescription
- Specified by:
getFullDescription
in interfaceIReducedSymbol
- Overrides:
getFullDescription
in classSymbol
-
setValue
Description copied from class:Symbol
Assigns a value to this Symbol. -
getDeclFunctionStmt
- Specified by:
getDeclFunctionStmt
in interfaceIDynamicFunctionSymbol
-
setDeclFunctionStmt
-
hashCode
public int hashCode() -
equals
-
getParameterizedVersion
- Specified by:
getParameterizedVersion
in classAbstractDynamicSymbol
-
clearDefn
public void clearDefn()Used to remove definition compiled info from this class. -
setArgs
-
setSuperDfs
-
getSuperDfs
- Specified by:
getSuperDfs
in interfaceIDynamicFunctionSymbol
-
hasTypeVariables
public boolean hasTypeVariables()- Specified by:
hasTypeVariables
in interfaceIReducedSymbol
- Overrides:
hasTypeVariables
in classAbstractDynamicSymbol
-
hasOptionalParameters
public boolean hasOptionalParameters() -
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
-
setAnnotationDefault
-