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 IExpressionprivate booleanprivate FunctionStatementprivate MethodCallStatementprivate Objectprivate Stringprivate DynamicFunctionSymbolprivate static final Objectprivate static final ObjectFields inherited from class gw.internal.gosu.parser.AbstractDynamicSymbol
_scriptPartId, _symTableFields 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.protectedDynamicFunctionSymbol(ISymbolTable symTable, CharSequence name, IFunctionType type, List<ISymbol> args, Object value) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidUsed to remove definition compiled info from this class.private voidbooleanprivate IGosuClassgetArgs()IType[]protected StringReturns the Symbol's optional display name.protected DynamicFunctionSymbolCreates 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 StringgetSignatureName(CharSequence strName) static StringgetSignatureName(CharSequence strName, List<ISymbol> args) private static StringinthashCode()booleanbooleanInvokes the dynamic function.private ObjectinvokeFromBytecode(Object[] args) booleanbooleanbooleanbooleanisFinal()booleanbooleanvoidrenameAsErrantDuplicate(int iIndex) voidsetAbstract(boolean bAbstract) voidsetAnnotationDefault(IExpression annotationDefault) voidvoidsetDeclFunctionStmt(FunctionStatement declFunctionStmt) protected voidsetDisplayName(String strDisplayName) voidsetFinal(boolean bFinal) voidsetInitializer(MethodCallStatement initializer) voidsetLoopImplicitReturn(boolean bLoopImplicitReturn) voidsetSuperDfs(DynamicFunctionSymbol superDfs) voidAssigns a value to this Symbol.Methods inherited from class gw.internal.gosu.parser.AbstractDynamicSymbol
assignIndex, getCompiledStatementDirectly, getGosuClass, getScriptPart, getSymbolTable, hasDynamicSymbolTable, isFromJava, isLocal, setDynamicSymbolTable, setScriptPartMethods 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, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface gw.lang.parser.IDynamicFunctionSymbol
getValueDirectly, isOverride, isStaticMethods inherited from interface gw.lang.parser.IDynamicSymbol
getGosuClass, getScriptPartMethods inherited from interface gw.lang.parser.IFunctionSymbol
getModifiers, isFromJava, isStackSymbolMethods inherited from interface gw.lang.parser.IReducedSymbol
getAnnotations, getSymbolClass, getType, isInternal, isPrivate, isProtected, isPublicMethods 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:
renameAsErrantDuplicatein classSymbol
-
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
-
getArgs
- Specified by:
getArgsin interfaceIDynamicFunctionSymbol- Returns:
- The Symbols for the arguments to this function.
-
getArgTypes
- Specified by:
getArgTypesin interfaceIDynamicFunctionSymbol
-
getReturnType
- Specified by:
getReturnTypein interfaceIDynamicFunctionSymbol
-
invoke
Invokes the dynamic function.- Specified by:
invokein interfaceIFunctionSymbol- Overrides:
invokein 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:
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
Description copied from interface:IFunctionSymbolReturns a description of arguments of the form ( < argName1 >, < argName2 >, etc. ) appropriate for display in a source editor ui.- Specified by:
getSignatureDescriptionin interfaceIFunctionSymbol- Overrides:
getSignatureDescriptionin classSymbol
-
getLightWeightReference
Description copied from interface:ISymbolCreates a copy of this symbol without the value so that the empty symbol can be stored.- Specified by:
getLightWeightReferencein interfaceISymbol- Specified by:
getLightWeightReferencein classAbstractDynamicSymbol
-
getMethodSignature
- Specified by:
getMethodSignaturein interfaceIDynamicFunctionSymbol
-
getSignatureName
-
getSignatureName
-
getParameterDisplay
- Specified by:
getParameterDisplayin interfaceIDynamicFunctionSymbol
-
getUniqueNameForParameters
-
getFunctionSymbol
-
setInitializer
-
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
-
setFinal
public void setFinal(boolean bFinal) -
getBackingDfs
- Specified by:
getBackingDfsin interfaceIDynamicFunctionSymbol
-
getMethodOrConstructorInfo
- Specified by:
getMethodOrConstructorInfoin interfaceIDynamicFunctionSymbol
-
getMethodOrConstructorInfo
- Specified by:
getMethodOrConstructorInfoin interfaceIDynamicFunctionSymbol
-
getDeclaringTypeInfo
- Specified by:
getDeclaringTypeInfoin interfaceIDynamicFunctionSymbol
-
getFullDescription
- Specified by:
getFullDescriptionin interfaceIReducedSymbol- Overrides:
getFullDescriptionin classSymbol
-
setValue
Description copied from class:SymbolAssigns a value to this Symbol. -
getDeclFunctionStmt
- Specified by:
getDeclFunctionStmtin interfaceIDynamicFunctionSymbol
-
setDeclFunctionStmt
-
hashCode
public int hashCode() -
equals
-
getParameterizedVersion
- Specified by:
getParameterizedVersionin classAbstractDynamicSymbol
-
clearDefn
public void clearDefn()Used to remove definition compiled info from this class. -
setArgs
-
setSuperDfs
-
getSuperDfs
- Specified by:
getSuperDfsin interfaceIDynamicFunctionSymbol
-
hasTypeVariables
public boolean hasTypeVariables()- Specified by:
hasTypeVariablesin interfaceIReducedSymbol- Overrides:
hasTypeVariablesin classAbstractDynamicSymbol
-
hasOptionalParameters
public boolean hasOptionalParameters() -
createReducedSymbol
- Specified by:
createReducedSymbolin interfaceIDynamicFunctionSymbol- Specified by:
createReducedSymbolin interfaceISymbol- Overrides:
createReducedSymbolin classSymbol
-
setLoopImplicitReturn
public void setLoopImplicitReturn(boolean bLoopImplicitReturn) -
isLoopImplicitReturn
public boolean isLoopImplicitReturn() -
getAnnotationDefault
-
setAnnotationDefault
-