Class IdentNode

All Implemented Interfaces:
FunctionCall, PropertyKey, Cloneable

public final class IdentNode extends Expression implements PropertyKey, FunctionCall
IR representation for an identifier.
  • Constructor Details

    • IdentNode

      public IdentNode(long token, int finish, com.oracle.truffle.api.strings.TruffleString name)
      Constructor
      Parameters:
      token - token
      finish - finish position
      name - name of identifier
  • Method Details

    • accept

      public Node accept(NodeVisitor<? extends LexicalContext> visitor)
      Assist in IR navigation.
      Specified by:
      accept in class Node
      Parameters:
      visitor - IR navigating visitor.
      Returns:
      node the node or its replacement after visitation, null if no further visitations are required
    • accept

      public <R> R accept(TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
      Description copied from class: Node
      Provides a means to navigate the IR.
      Specified by:
      accept in class Node
      Parameters:
      visitor - Node visitor.
      Returns:
      node the node or its replacement after visitation, null if no further visitations are required
    • toString

      public void toString(StringBuilder sb, boolean printType)
      Description copied from class: Node
      Print logic that decides whether to show the optimistic type or not - for example it should not be printed after just parse, when it hasn't been computed, or has been set to a trivially provable value
      Specified by:
      toString in class Node
      Parameters:
      sb - string builder
      printType - print type?
    • getName

      public String getName()
      Get the name of the identifier
      Returns:
      IdentNode name
    • getNameTS

      public com.oracle.truffle.api.strings.TruffleString getNameTS()
    • getPropertyName

      public String getPropertyName()
      Description copied from interface: PropertyKey
      Get the property name.
      Specified by:
      getPropertyName in interface PropertyKey
      Returns:
      the property name
    • getPropertyNameTS

      public com.oracle.truffle.api.strings.TruffleString getPropertyNameTS()
      Specified by:
      getPropertyNameTS in interface PropertyKey
    • getSymbol

      public Symbol getSymbol()
      Return the Symbol the compiler has assigned to this identifier. The symbol is a description of the storage location for the identifier.
      Returns:
      the symbol
    • isPropertyName

      public boolean isPropertyName()
      Check if this IdentNode is a property name
      Returns:
      true if this is a property name
    • setIsPropertyName

      public IdentNode setIsPropertyName()
      Flag this IdentNode as a property name
      Returns:
      a node equivalent to this one except for the requested change.
    • isInitializedHere

      public boolean isInitializedHere()
      Helper function for local def analysis.
      Returns:
      true if IdentNode is initialized on creation
    • setIsInitializedHere

      public IdentNode setIsInitializedHere()
      Flag IdentNode to be initialized on creation
      Returns:
      a node equivalent to this one except for the requested change.
    • isDeclaredHere

      public boolean isDeclaredHere()
      Is this IdentNode declared here?
      Returns:
      true if identifier is declared here
    • setIsDeclaredHere

      public IdentNode setIsDeclaredHere()
      Flag this IdentNode as being declared here.
      Returns:
      a new IdentNode equivalent to this but marked as declared here.
    • isFunction

      public boolean isFunction()
      Description copied from interface: FunctionCall
      Returns true if the value of this expression will be treated as a function and immediately invoked.
      Specified by:
      isFunction in interface FunctionCall
    • isInternal

      public boolean isInternal()
      Is this an internal symbol, i.e. one that starts with ':'. Those can never be optimistic.
      Returns:
      true if internal symbol
    • isThis

      public boolean isThis()
    • setIsThis

      public IdentNode setIsThis()
    • isSuper

      public boolean isSuper()
    • setIsSuper

      public IdentNode setIsSuper()
    • isDirectSuper

      public boolean isDirectSuper()
    • setIsDirectSuper

      public IdentNode setIsDirectSuper()
    • isRestParameter

      public boolean isRestParameter()
    • setIsRestParameter

      public IdentNode setIsRestParameter()
    • isCatchParameter

      public boolean isCatchParameter()
    • setIsCatchParameter

      public IdentNode setIsCatchParameter()
    • isNewTarget

      public boolean isNewTarget()
    • setIsNewTarget

      public IdentNode setIsNewTarget()
    • isImportMeta

      public boolean isImportMeta()
    • setIsImportMeta

      public IdentNode setIsImportMeta()
    • isMetaProperty

      public boolean isMetaProperty()
    • setIsArguments

      public IdentNode setIsArguments()
    • isArguments

      public boolean isArguments()
    • setIsApplyArguments

      public IdentNode setIsApplyArguments()
    • isApplyArguments

      public boolean isApplyArguments()
    • setIsPrivate

      public IdentNode setIsPrivate()
    • isPrivate

      public boolean isPrivate()
    • setIsPrivateInCheck

      public IdentNode setIsPrivateInCheck()
    • isPrivateInCheck

      public boolean isPrivateInCheck()
    • setIsIgnoredParameter

      public IdentNode setIsIgnoredParameter()
    • isIgnoredParameter

      public boolean isIgnoredParameter()