Package gw.internal.gosu.parser
Class AbstractDynamicSymbol
- java.lang.Object
-
- gw.internal.gosu.parser.Symbol
-
- gw.internal.gosu.parser.AbstractDynamicSymbol
-
- All Implemented Interfaces:
IDynamicSymbol
,IFunctionSymbol
,IHasType
,IReducedSymbol
,ISymbol
- Direct Known Subclasses:
DynamicFunctionSymbol
,DynamicPropertySymbol
,DynamicSymbol
public abstract class AbstractDynamicSymbol extends Symbol implements IDynamicSymbol, IReducedSymbol
-
-
Field Summary
Fields Modifier and Type Field Description protected IScriptPartId
_scriptPartId
protected ISymbolTable
_symTable
-
Fields inherited from class gw.internal.gosu.parser.Symbol
_bGlobal, _iIndex, _stackProvider, _symbolTable, _value, MEMBER_STACK_PROVIDER
-
-
Constructor Summary
Constructors Constructor Description AbstractDynamicSymbol(ISymbolTable symTable, CharSequence strName, IType type)
Constructs AbstractDynamicSymbol for use with an IGosuParser's ISymbolTable.AbstractDynamicSymbol(ISymbolTable symTable, CharSequence strName, IType type, Object value)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected int
assignIndex(IScope scope)
void
clearDebugInfo()
IGosuClassInternal
getGosuClass()
abstract ISymbol
getLightWeightReference()
Creates a copy of this symbol without the value so that the empty symbol can be stored.abstract AbstractDynamicSymbol
getParameterizedVersion(IGosuClass gsClass)
IScriptPartId
getScriptPart()
ISymbolTable
getSymbolTable()
boolean
hasDynamicSymbolTable()
boolean
hasTypeVariables()
boolean
isFromJava()
boolean
isLocal()
void
setDynamicSymbolTable(ISymbolTable symTable)
Assigns an optional symbol table so that the symbol can get/set its value dynamically e.g., via ThreadLocalSymbolTable.void
setScriptPart(IScriptPartId partId)
-
Methods inherited from class gw.internal.gosu.parser.Symbol
assignIndexInStack, canBeCaptured, createReducedSymbol, equals, getAnnotations, getDefaultValueExpression, getDisplayName, getDynamicSymbolTable, getFullDescription, getIndex, getModifierInfo, getModifiers, getName, getSignatureDescription, getSymbolClass, getType, getValue, getValueDirectly, invoke, isAbstract, isClassMember, isFinal, isHide, isImplicitlyInitialized, isInternal, isOverride, isPrivate, isProtected, isPublic, isReified, isStackSymbol, isStatic, isValueBoxed, isWritable, makeCapturedSymbol, renameAsErrantDuplicate, replaceModifierInfo, setAbstract, setClassMember, setDefaultValueExpression, setFinal, setHide, setIndex, setInternal, setModifierInfo, setModifiers, setName, setOverride, setPrivate, setProtected, setPublic, setReified, setStatic, setType, setValue, setValueDirectly, setValueIsBoxed, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gw.lang.parser.IFunctionSymbol
getModifiers, getSignatureDescription, invoke, isStackSymbol
-
Methods inherited from interface gw.lang.parser.IReducedSymbol
getAnnotations, getFullDescription, getSymbolClass, getType, isAbstract, isFinal, isInternal, isPrivate, isProtected, isPublic, isReified, isStatic
-
Methods inherited from interface gw.lang.parser.ISymbol
canBeCaptured, createReducedSymbol, getDefaultValueExpression, getDisplayName, getDynamicSymbolTable, getIndex, getModifierInfo, getName, getType, getValue, isValueBoxed, isWritable, makeCapturedSymbol, setDefaultValueExpression, setType, setValue, setValueIsBoxed
-
-
-
-
Field Detail
-
_symTable
protected ISymbolTable _symTable
-
_scriptPartId
protected IScriptPartId _scriptPartId
-
-
Constructor Detail
-
AbstractDynamicSymbol
public AbstractDynamicSymbol(ISymbolTable symTable, CharSequence strName, IType type)
Constructs AbstractDynamicSymbol for use with an IGosuParser's ISymbolTable.- Parameters:
symTable
- The symbol table.strName
- The symbol name.type
- The IGosuParser specific type.
-
AbstractDynamicSymbol
public AbstractDynamicSymbol(ISymbolTable symTable, CharSequence strName, IType type, Object value)
-
-
Method Detail
-
assignIndex
protected int assignIndex(IScope scope)
- Overrides:
assignIndex
in classSymbol
-
setDynamicSymbolTable
public void setDynamicSymbolTable(ISymbolTable symTable)
Description copied from interface:ISymbol
Assigns an optional symbol table so that the symbol can get/set its value dynamically e.g., via ThreadLocalSymbolTable.- Specified by:
setDynamicSymbolTable
in interfaceISymbol
- Overrides:
setDynamicSymbolTable
in classSymbol
-
hasDynamicSymbolTable
public boolean hasDynamicSymbolTable()
- Specified by:
hasDynamicSymbolTable
in interfaceISymbol
- Overrides:
hasDynamicSymbolTable
in classSymbol
-
getScriptPart
public IScriptPartId getScriptPart()
- Specified by:
getScriptPart
in interfaceIDynamicSymbol
- Specified by:
getScriptPart
in interfaceIReducedSymbol
- Overrides:
getScriptPart
in classSymbol
- Returns:
- This is used for storing runtime implementation specific data. Typically, this field will contain a reference to the class (or executable unit) containing this function.
-
setScriptPart
public void setScriptPart(IScriptPartId partId)
-
getGosuClass
public IGosuClassInternal getGosuClass()
- Specified by:
getGosuClass
in interfaceIDynamicSymbol
- Specified by:
getGosuClass
in interfaceIReducedSymbol
- Overrides:
getGosuClass
in classSymbol
-
clearDebugInfo
public void clearDebugInfo()
-
getSymbolTable
public ISymbolTable getSymbolTable()
-
isFromJava
public boolean isFromJava()
- Specified by:
isFromJava
in interfaceIFunctionSymbol
- Overrides:
isFromJava
in classSymbol
- Returns:
- true if this function symbol came from a java superclass
-
getLightWeightReference
public abstract ISymbol 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
- Overrides:
getLightWeightReference
in classSymbol
-
getParameterizedVersion
public abstract AbstractDynamicSymbol getParameterizedVersion(IGosuClass gsClass)
-
isLocal
public boolean isLocal()
-
hasTypeVariables
public boolean hasTypeVariables()
- Specified by:
hasTypeVariables
in interfaceIReducedSymbol
- Overrides:
hasTypeVariables
in classSymbol
-
-