SDA SE Wiki

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

User Tools

Site Tools



operationT (#id, #parent, #encl, [#arg1,...], 'operatorName', pos)

Represents use of an operator in infix, postfix or prefix notation.

Arguments

#id: id
the unique ID assigned to this fact.

#parent: id
ID of the parent node.

#encl: methodT, constructorT, classInitializerT, fieldT, classT
ID of the fact that represents the enclosing element. (classT if used in a memberValueT)

[#arg1,…]: expression
The list of operands of this expression.

operatorName: atom
The operator of this expression (!,+,-,/,*,«,…).

operatorPosition: number
postfix: 1
infix: 0
prefix: -1

Sample Java Code

void expression(){
	int i = 0;
	i++;                // source code line  corresponding to operationT PEF below
}

Its PEF Representation

methodT(#encl, ..., 'expression', [], type(basic, void, 0), [], ...).
execT(#parent, ..., #encl, #id).
operationT(#id, #parent, #encl, [#arg1], '++', 1).        % PEF corresponding to i++
identT(#arg1, #id, #encl, 'i', ...).

AST Specification

ast_node_type_spec(operationT,[
     ast_arg(id,     mult(1,1,no ), id,  [operationT]),
     ast_arg(parent, mult(1,1,no ), id,  [id]),
     ast_arg(encl,   mult(1,1,no ), id,  [methodT, constructorT, classInitializerT,fieldT,classT]),
     ast_arg(args,   mult(1,*,ord), id,  [expressionType]),
     ast_arg(op,     mult(1,1,no ), attr,[atomic]),
     ast_arg(pos,    mult(1,1,no ), attr,[number])
]).
research/jtransformer/api/java/pefs/4.0/operationt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2025