Package org.mozilla.javascript.ast
Class Symbol
- java.lang.Object
-
- org.mozilla.javascript.ast.Symbol
-
public class Symbol extends Object
Represents a symbol-table entry.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScopegetContainingTable()Returns the Scope in which this symbol is enteredintgetDeclType()Returns symbol declaration typeStringgetDeclTypeName()intgetIndex()Returns symbol's index in its scopeStringgetName()Returns symbol nameNodegetNode()Returns the node associated with this identifiervoidsetContainingTable(Scope containingTable)Sets this symbol's ScopevoidsetDeclType(int declType)Sets symbol declaration typevoidsetIndex(int index)Sets symbol's index in its scopevoidsetName(String name)Sets symbol namevoidsetNode(Node node)Sets the node associated with this identifierStringtoString()
-
-
-
Constructor Detail
-
Symbol
public Symbol()
-
Symbol
public Symbol(int declType, String name)Constructs a new Symbol with a specific name and declaration type- Parameters:
declType-Token.FUNCTION,Token.LP(for params),Token.VAR,Token.LETorToken.CONST
-
-
Method Detail
-
getDeclType
public int getDeclType()
Returns symbol declaration type
-
setDeclType
public void setDeclType(int declType)
Sets symbol declaration type
-
getName
public String getName()
Returns symbol name
-
setName
public void setName(String name)
Sets symbol name
-
getNode
public Node getNode()
Returns the node associated with this identifier
-
getIndex
public int getIndex()
Returns symbol's index in its scope
-
setIndex
public void setIndex(int index)
Sets symbol's index in its scope
-
setNode
public void setNode(Node node)
Sets the node associated with this identifier
-
getContainingTable
public Scope getContainingTable()
Returns the Scope in which this symbol is entered
-
setContainingTable
public void setContainingTable(Scope containingTable)
Sets this symbol's Scope
-
getDeclTypeName
public String getDeclTypeName()
-
-