java.lang.Object
org.htmlunit.corejs.javascript.ast.Symbol

public class Symbol extends Object
Represents a symbol-table entry.
  • Constructor Details

  • Method Details

    • getDeclType

      public Symbol.Type getDeclType()
      Returns symbol declaration type
    • setDeclType

      public void setDeclType(Symbol.Type 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
    • getDeclaredScope

      public Scope getDeclaredScope()
      Returns the lexical scope in which this symbol was declared, or null if not set. For VAR symbols this is the block scope containing the declaration, which may differ from getContainingTable() (the enclosing function/script to which the var is hoisted).
    • setDeclaredScope

      public void setDeclaredScope(Scope declaredScope)
      Sets the lexical scope in which this symbol was declared.
    • getDeclTypeName

      public String getDeclTypeName()
    • isDeclTypeLexical

      public boolean isDeclTypeLexical()
    • isDeclTypeLexical

      public static boolean isDeclTypeLexical(Symbol.Type declType)
    • toString

      public String toString()
      Overrides:
      toString in class Object