Package gw.internal.gosu.parser
Class Symbol
- java.lang.Object
-
- gw.internal.gosu.parser.Symbol
-
- All Implemented Interfaces:
IFunctionSymbol
,IHasType
,IReducedSymbol
,ISymbol
- Direct Known Subclasses:
AbstractDynamicSymbol
,AmbiguousSymbol
,CapturedSymbol
,CommonSymbolsScope.LockedDownSymbol
,CompileTimeExpressionParser.CompileTimeFieldSymbol
,QueryPathRootSymbol
,ReadOnlySymbol
,ReducedSymbol.SyntheticSymbol
,TemplateGenerator.LockedDownSymbol
,ThisSymbol
,TypedSymbol
public class Symbol extends Object implements IFunctionSymbol
Base class for all symbols in the symbol table.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
_bGlobal
protected int
_iIndex
protected IStackProvider
_stackProvider
protected ISymbolTable
_symbolTable
protected Object
_value
static IStackProvider
MEMBER_STACK_PROVIDER
-
Constructor Summary
Constructors Constructor Description Symbol(Symbol copy)
Symbol(String strName, IType type, IStackProvider stackProvider)
Symbol(String strName, IType type, IStackProvider stackProvider, Object value)
Symbol(String strName, IType type, IStackProvider stackProvider, Object value, IScope scope)
Symbol(String strName, IType type, Object value)
-
Method Summary
-
-
-
Field Detail
-
MEMBER_STACK_PROVIDER
public static final IStackProvider MEMBER_STACK_PROVIDER
-
_value
protected Object _value
-
_iIndex
protected int _iIndex
-
_bGlobal
protected boolean _bGlobal
-
_stackProvider
protected IStackProvider _stackProvider
-
_symbolTable
protected ISymbolTable _symbolTable
-
-
Constructor Detail
-
Symbol
public Symbol(String strName, IType type, IStackProvider stackProvider)
-
Symbol
public Symbol(String strName, IType type, IStackProvider stackProvider, Object value)
-
Symbol
public Symbol(String strName, IType type, IStackProvider stackProvider, Object value, IScope scope)
-
Symbol
public Symbol(Symbol copy)
-
-
Method Detail
-
setDynamicSymbolTable
public void setDynamicSymbolTable(ISymbolTable symTable)
- Specified by:
setDynamicSymbolTable
in interfaceISymbol
-
hasDynamicSymbolTable
public boolean hasDynamicSymbolTable()
- Specified by:
hasDynamicSymbolTable
in interfaceISymbol
-
getDynamicSymbolTable
public ISymbolTable getDynamicSymbolTable()
- Specified by:
getDynamicSymbolTable
in interfaceISymbol
-
assignIndex
protected int assignIndex(IScope scope)
-
assignIndexInStack
protected int assignIndexInStack(IScope scope)
-
getName
public String getName()
Returns the Symbol's name.- Specified by:
getName
in interfaceIReducedSymbol
- Specified by:
getName
in interfaceISymbol
-
getDisplayName
public String getDisplayName()
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
-
getFullDescription
public String getFullDescription()
- Specified by:
getFullDescription
in interfaceIReducedSymbol
-
renameAsErrantDuplicate
public void renameAsErrantDuplicate(int iIndex)
-
getType
public IType getType()
Returns the Symbol's type.
-
setType
public void setType(IType type)
Sets the Symbol's type.
-
getValue
public Object getValue()
Returns the value assigned to this Symbol.
-
setValue
public void setValue(Object value)
Assigns a value to this Symbol.
-
getDefaultValueExpression
public IExpression getDefaultValueExpression()
- Specified by:
getDefaultValueExpression
in interfaceIReducedSymbol
- Specified by:
getDefaultValueExpression
in interfaceISymbol
-
setDefaultValueExpression
public void setDefaultValueExpression(IExpression defaultValue)
- Specified by:
setDefaultValueExpression
in interfaceISymbol
-
isStackSymbol
public boolean isStackSymbol()
- Specified by:
isStackSymbol
in interfaceIFunctionSymbol
-
getValueDirectly
public Object getValueDirectly()
-
setValueDirectly
public void setValueDirectly(Object value)
-
invoke
public Object invoke(Object[] args)
Invokes function.- Specified by:
invoke
in interfaceIFunctionSymbol
-
getLightWeightReference
public ISymbol getLightWeightReference()
- Specified by:
getLightWeightReference
in interfaceISymbol
-
isImplicitlyInitialized
public boolean isImplicitlyInitialized()
-
isWritable
public boolean isWritable()
- Specified by:
isWritable
in interfaceISymbol
-
getSignatureDescription
public String getSignatureDescription()
- Specified by:
getSignatureDescription
in interfaceIFunctionSymbol
-
getIndex
public int getIndex()
- Specified by:
getIndex
in interfaceIReducedSymbol
- Specified by:
getIndex
in interfaceISymbol
-
isClassMember
public boolean isClassMember()
-
setClassMember
public void setClassMember(boolean bClassMember)
-
isStatic
public boolean isStatic()
- Specified by:
isStatic
in interfaceIReducedSymbol
-
setStatic
public void setStatic(boolean bStatic)
-
isPrivate
public boolean isPrivate()
- Specified by:
isPrivate
in interfaceIReducedSymbol
-
setPrivate
public void setPrivate(boolean bPrivate)
-
isInternal
public boolean isInternal()
- Specified by:
isInternal
in interfaceIReducedSymbol
-
setInternal
public void setInternal(boolean bInternal)
-
isProtected
public boolean isProtected()
- Specified by:
isProtected
in interfaceIReducedSymbol
-
setProtected
public void setProtected(boolean bProtected)
-
isPublic
public boolean isPublic()
- Specified by:
isPublic
in interfaceIReducedSymbol
-
setPublic
public void setPublic(boolean bPublic)
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstract
in interfaceIReducedSymbol
-
setAbstract
public void setAbstract(boolean bAbstract)
-
isFinal
public boolean isFinal()
- Specified by:
isFinal
in interfaceIReducedSymbol
-
setFinal
public void setFinal(boolean bFinal)
-
isReified
public boolean isReified()
- Specified by:
isReified
in interfaceIReducedSymbol
-
setReified
public void setReified(boolean bReified)
-
isOverride
public boolean isOverride()
-
setOverride
public void setOverride(boolean bOverride)
-
isHide
public boolean isHide()
-
setHide
public void setHide(boolean bHide)
-
getModifierInfo
public ModifierInfo getModifierInfo()
- Specified by:
getModifierInfo
in interfaceISymbol
-
setModifierInfo
public void setModifierInfo(IModifierInfo modifiers)
-
replaceModifierInfo
public void replaceModifierInfo(IModifierInfo mi)
-
getModifiers
public int getModifiers()
- Specified by:
getModifiers
in interfaceIFunctionSymbol
- Specified by:
getModifiers
in interfaceIReducedSymbol
-
getAnnotations
public List<IGosuAnnotation> getAnnotations()
- Specified by:
getAnnotations
in interfaceIReducedSymbol
-
getScriptPart
public IScriptPartId getScriptPart()
- Specified by:
getScriptPart
in interfaceIReducedSymbol
-
getGosuClass
public IGosuClass getGosuClass()
- Specified by:
getGosuClass
in interfaceIReducedSymbol
-
hasTypeVariables
public boolean hasTypeVariables()
- Specified by:
hasTypeVariables
in interfaceIReducedSymbol
-
setModifiers
public void setModifiers(int modifiers)
-
canBeCaptured
public boolean canBeCaptured()
- Specified by:
canBeCaptured
in interfaceISymbol
-
makeCapturedSymbol
public ICapturedSymbol makeCapturedSymbol(String strName, ISymbolTable symbolTable, IScope scope)
- Specified by:
makeCapturedSymbol
in interfaceISymbol
-
setIndex
public void setIndex(int i)
-
setValueIsBoxed
public void setValueIsBoxed(boolean b)
- Specified by:
setValueIsBoxed
in interfaceISymbol
-
isValueBoxed
public boolean isValueBoxed()
- Specified by:
isValueBoxed
in interfaceIReducedSymbol
- Specified by:
isValueBoxed
in interfaceISymbol
-
setName
protected void setName(String name)
-
isFromJava
public boolean isFromJava()
- Specified by:
isFromJava
in interfaceIFunctionSymbol
-
getSymbolClass
public Class getSymbolClass()
- Specified by:
getSymbolClass
in interfaceIReducedSymbol
-
createReducedSymbol
public IReducedSymbol createReducedSymbol()
- Specified by:
createReducedSymbol
in interfaceISymbol
-
-