SDA SE Wiki

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

User Tools

Site Tools



localT(#id, #parent, #encl, TYPE, 'name', #init)

Represents local variable declaration.

Arguments

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

#parent: id
ID of the parent node.

#encl: methodT, constructorT, classInitializerT
ID of the enclosing element.

TYPE: typeterm
type of the variable

'name': atom
variable name.

#init: expression, null
ID of the initializer of this variable declaration.

Sample Java Code

void myFunction(){
	int i = 0;//corresponding code line to localT
}

Its PEF Representation

methodT(#enclMethod, ..., 'myFunction', [], type(basic, void, 0), [], #parent).
blockT(#parent, #enclMethod, #enclMethod, [#id]).
localT(#id, #parent, #enclMethod, type(basic, int, 0), 'i', #init).
literalT(#init, #id, #enclMethod, type(basic, int, 0), '0').

AST Specification

ast_node_def('Java',localT,[
     ast_arg(id,      mult(1,1,no ), id,  [localT]), % <-- convention!!!
     ast_arg(parent,  mult(1,1,no ), id,  [id]),
     ast_arg(encl,    mult(1,1,no ), id,  [methodT, constructorT, classInitializerT]),
     ast_arg(type,    mult(1,1,no ), attr,[typeTermType]),
     ast_arg(name,    mult(1,1,no ), attr,[atom]),
     ast_arg(expr,    mult(0,1,no), id,  [expressionType,nullType])
]).
research/jtransformer/api/java/pefs/2.9/localt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019