- All Superinterfaces:
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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.civl.abc.ast.node.IF.ASTNode
ASTNode.NodeKind -
Method Summary
Methods inherited from interface dev.civl.abc.ast.node.IF.ASTNode
addAllTransformAnnotations, addTransformAnnotation, child, childIndex, children, diff, equiv, getAttribute, getOwner, getScope, getSource, id, keepOnly, nextDFS, nodeKind, numChildren, parent, prettyPrint, prettyRepresentation, prettyRepresentation, print, remove, removeChild, removeTransformAnnotation, setAttribute, setChild, setId, setOwner, setScope, toString, transformAnnotations
-
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
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
nullif that information has not yet been computed
-
setEntity
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
IdentifierNode copy()Description copied from interface:ASTNodeReturns 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.
-