SDA SE Wiki

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

User Tools

Site Tools


Module java_queries

Enclosing

encl_project(+Id, -ProjectId) is semidet
encl_project(-Id, +ProjectId) is nondet

Unifies ProjectId with the
enclosing Project of the tree Id.
encl_package(+Id, -PackageId) is semidet
encl_package(-Id, +PackageId) is nondet

Unifies PackageId with the
enclosing Package of the tree Id.
encl_compilation_unit(+Tree:id, -UnitId:id) is semidet
encl_compilation_unit(-Tree:id, +UnitId:id) is nondet

Unifies upon success UnitId with the
enclosing compilation unit of the tree Id.
encl_toplevel_class(+Id:id, -Class:id) is semidet
encl_toplevel_class(-Id:id, +Class:id) is nondet
encl_toplevel_class(-Id:id, -Class:id) is nondet

Is successfull if Class is the enclosing toplevel class of the AST-element Id.
encl_class(+Tree:id, -ClassId:id) is semidet
encl_class(-Tree:id, +ClassId:id) is nondet

Unifies ClassId with the
enclosing class of the tree Id.
encl_class_or_self(?Id, -ClassId) is semidet

Unifies ClassId with the
enclosing class of the tree Id.
encl_method(+Tree:id, -MethodId:id) is semidet
encl_method(-Tree:id, +MethodId:id) is nondet

Unifies MethodId with the
enclosing method of the tree Id.
encl_block(+Tree:id, -BlockId:id) is semidet
encl_block(-Tree:id, +BlockId:id) is nondet

BlockId is the enclosing block of Tree.
encl_block_member(+Id:id, -BlockMember:id) is semidet
encl_block_member(-Id:id, ?BlockMember:id) is nondet

BlockMember is the closest ancestor of ID
that has a block as its parent.
encl_declaration(+Id:id, ?EnclId:id) is semidet

If Id denotes a method body element, EnclId is its enclosing declaration
(method, constructor, initializer or field).

Typing

get_type(PEF:id, _Type) is semidet

Binds the second parameter to the type of the ast element.
subtype(?Sub, ?Super) is nondet

Binds Super to itself, any direct or
indirect super type of Sub.
proper_subtype(?Sub, ?Super) is nondet

Binds Super to any direct or
indirect super type of Sub.
type_exists(+Type) is semidet

Type is a type term.

Navigation

sub_trees(+Id:int, -Subtrees:list) is nondet

Binds all sub trees of the id to Subtrees.
get_referenced(?Id:id, ?Declaration:id) is nondet

Binds Declaration to the ID of the element referenced
by a getFieldT, callT, identT of selectT.

Properties

toplevel_class(+Class:id, ?Package:id, ?ClassName:atom, ?Members:[id]) is semidet
toplevel_class(-Class:id, ?Package:id, ?ClassName:atom, ?Members:[id]) is nondet

Suceeds if Class is the immediate child of a compilation unit,
not nested within any other class.
source_element(+Id) is semidet

Checks if Id is a pef defined in a
source class.

Util

package_path(+Pckgname, -PckgPath) is det

Replaces dots with slashes in the package name Pckgname.

encl_project/2

encl_project(+Id, -ProjectId) is semidet
encl_project(-Id, +ProjectId) is nondet

Unifies ProjectId with the
enclosing Project of the tree Id.

encl_package/2

encl_package(+Id, -PackageId) is semidet
encl_package(-Id, +PackageId) is nondet

Unifies PackageId with the
enclosing Package of the tree Id.
Fails if Id is a package id.

encl_compilation_unit/2

encl_compilation_unit(+Tree:id, -UnitId:id) is semidet
encl_compilation_unit(-Tree:id, +UnitId:id) is nondet

Unifies upon success UnitId with the
enclosing compilation unit of the tree Id.

encl_toplevel_class/2

encl_toplevel_class(+Id:id, -Class:id) is semidet
encl_toplevel_class(-Id:id, +Class:id) is nondet
encl_toplevel_class(-Id:id, -Class:id) is nondet

Is successfull if Class is the enclosing toplevel class of the AST-element Id.

encl_class/2

encl_class(+Tree:id, -ClassId:id) is semidet
encl_class(-Tree:id, +ClassId:id) is nondet

Unifies ClassId with the
enclosing class of the tree Id.

encl_class_or_self/2

encl_class_or_self(?Id, -ClassId) is semidet

Unifies ClassId with the
enclosing class of the tree Id.
If Id is a class itself bind ClassID to Id.
Fails if Id is a package id.

encl_method/2

encl_method(+Tree:id, -MethodId:id) is semidet
encl_method(-Tree:id, +MethodId:id) is nondet

Unifies MethodId with the
enclosing method of the tree Id.

encl_block/2

encl_block(+Tree:id, -BlockId:id) is semidet
encl_block(-Tree:id, +BlockId:id) is nondet

BlockId is the enclosing block of Tree.

encl_block_member/2

encl_block_member(+Id:id, -BlockMember:id) is semidet
encl_block_member(-Id:id, ?BlockMember:id) is nondet

BlockMember is the closest ancestor of ID
that has a block as its parent.

encl_declaration/2

encl_declaration(+Id:id, ?EnclId:id) is semidet

If Id denotes a method body element, EnclId is its enclosing declaration
(method, constructor, initializer or field).
Otherwise, if Id has a defined parent EnclId is the parent of Id.
If the parent is not defined, EnclId is the same as Id!!!


get_type/2

get_type(PEF:id, _Type) is semidet

Binds the second parameter to the type of the ast element.

Legal PEFs:
localT | fieldT | paramT | methodT | callT |
identT | getFieldT | setFieldT | literalT |
newClassT | selectT | newArrayT | precedenceT

doesn't work for:
conditionalT,
indexedT for multi dimensional arrays .


subtype/2

subtype(?Sub, ?Super) is nondet

Binds Super to itself, any direct or
indirect super type of Sub.

Also for primitive types.


proper_subtype/2

proper_subtype(?Sub, ?Super) is nondet

Binds Super to any direct or
indirect super type of Sub.

Also for primitive types.


type_exists/1

type_exists(+Type) is semidet

Type is a type term.
This predicate checks if the type exists.


sub_trees/2

sub_trees(+Id:int, -Subtrees:list) is nondet

Binds all sub trees of the id to Subtrees.

this predicate should not be necessary, needed for "legacy" code
Use ast_node_sub_trees/3 instead.


get_referenced/2

get_referenced(?Id:id, ?Declaration:id) is nondet

Binds Declaration to the ID of the element referenced
by a getFieldT, callT, identT of selectT.


toplevel_class/4

toplevel_class(+Class:id, ?Package:id, ?ClassName:atom, ?Members:[id]) is semidet
toplevel_class(-Class:id, ?Package:id, ?ClassName:atom, ?Members:[id]) is nondet

Suceeds if Class is the immediate child of a compilation unit,
not nested within any other class.

source_element/1

source_element(+Id) is semidet

Checks if Id is a pef defined in a
source class.
The enclosing class is not marked with externT/1.


package_path/2

package_path(+Pckgname, -PckgPath) is det

Replaces dots with slashes in the package name Pckgname.

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

SEWiki, © 2019