Interface IdentifierNode

All Superinterfaces:
ASTNode

public interface IdentifierNode extends ASTNode
An identifier can denote: (1) an object, (2) a function, (3) a tag of a structure, union, or enumeration, (4) a member of a structure, union, or enumeration, (5) a typedef name, or (6) a label name. All of these things are called "entities". An identifier node represents any occurrence of an identifier in a program.
See Also:
  • Method Details

    • name

      String name()
      Returns the name of this identifier node. This is a non-null string. This is typically the string that actually appears in the source code.
      Returns:
      the name of this identifier
    • setName

      void setName(String name)
      Sets the name of this identifier.
      Parameters:
      name - new value for identifier name
    • getEntity

      Entity getEntity()
      Returns the entity to which this identifier refers. Every identifier refers to some entity: a variable, function, structure or union, typedef, enumeration, etc. All of those things are examples if entities. Typically, the entity starts off as null, and is set during the standard analysis phase. The information provided by the getEntity methods in the AST is what is typically referred to as the "symbol table".
      Returns:
      the entity to which this identifier refers, or null if that information has not yet been computed
    • setEntity

      void setEntity(Entity entity)
      Sets the entity to which this identifier refers. This method is typically called by the standard analysis routine, which computes this "symbol table" information.
      Parameters:
      entity - the entity to which this identifier refers; must be non-null
    • copy

      Description copied from interface: ASTNode
      Returns a deep copy of this AST node. The node and all of its descendants will be cloned. The cloning does not copy analysis or attribute information.
      Specified by:
      copy in interface ASTNode
      Returns:
      deep copy of this node