SDA SE WikiSoftware Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
Attributes is the list of all attribute values contained in the AST node with ID #id and type NodeType.
#id:
The unique ID of an AST node.
NodeType: atom
The type of the AST node (e.g. classDefT).
Attributes: list
All attribute values of the node (eg. the only attribute for a classDefT fact is the class name).
Please recall that attributes are primitive values (numbers and atoms).
Attributes and identities are the only two kinds of values that an AST node argument can contain.
If the factbase contains the following representation of the empty class 'MyClassName'
classDefT(10001, 10002, 'MyClassName', [] ).
then the query
?- ast_node_attributes(10001, classDefT, Attributes).
yields
Attributes = ['MyClassName'] yes
This is because the class name is the only attribute contained in a classDefT fact.
This predicate replaces tree_attributes.