SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


ast_node_attributes(+ #id, ? NodeType, ? Attributes) is det

Attributes is the list of all attribute values contained in the AST node with ID #id and type NodeType.

Arguments

#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.

Example

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.

Obsolete

This predicate replaces tree_attributes.

research/jtransformer/api/meta/queries/ast_node_attributes.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2025