java.lang.Object
org.htmlunit.corejs.javascript.ast.Symbol
Represents a symbol-table entry.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionSymbol()Symbol(Symbol.Type declType, String name) Constructs a new Symbol with a specific name and declaration type -
Method Summary
Modifier and TypeMethodDescriptionReturns the Scope in which this symbol is enteredReturns the lexical scope in which this symbol was declared, ornullif not set.Returns symbol declaration typeintgetIndex()Returns symbol's index in its scopegetName()Returns symbol namegetNode()Returns the node associated with this identifierbooleanstatic booleanisDeclTypeLexical(Symbol.Type declType) voidsetContainingTable(Scope containingTable) Sets this symbol's ScopevoidsetDeclaredScope(Scope declaredScope) Sets the lexical scope in which this symbol was declared.voidsetDeclType(Symbol.Type declType) Sets symbol declaration typevoidsetIndex(int index) Sets symbol's index in its scopevoidSets symbol namevoidSets the node associated with this identifiertoString()
-
Constructor Details
-
Symbol
public Symbol() -
Symbol
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 Details
-
getDeclType
Returns symbol declaration type -
setDeclType
Sets symbol declaration type -
getName
Returns symbol name -
setName
Sets symbol name -
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
Sets the node associated with this identifier -
getContainingTable
Returns the Scope in which this symbol is entered -
setContainingTable
Sets this symbol's Scope -
getDeclaredScope
Returns the lexical scope in which this symbol was declared, ornullif not set. For VAR symbols this is the block scope containing the declaration, which may differ fromgetContainingTable()(the enclosing function/script to which the var is hoisted). -
setDeclaredScope
Sets the lexical scope in which this symbol was declared. -
getDeclTypeName
-
isDeclTypeLexical
public boolean isDeclTypeLexical() -
isDeclTypeLexical
-
toString
-