SDA SE Wiki

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

User Tools

Site Tools



typeCastT (#id, #parent, #encl, TYPE, #expr)

Represents the cast expression.

Arguements

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

#parent: id
ID of the parent node.

#encl: methodT, constructorT, classInitializerT, fieldT, annotationMemberT
ID of the fact that represents the enclosing element.

TYPE: typeterm
the target type

#expr: expression
ID of the expression of this cast expression.

Sample Java Source

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

Its PEF Representation

typeCastT(#id, #parent, #encl, type(basic, double, 0), #expr).
assignT(#parent, ..., #encl, ..., #id).
methodT(#encl, ..., 'myFunction', [], type(basic, void, 0), [], ...).
identT(#expr, #id, #encl, 'j', ...).

AST Specification

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

SEWiki, © 2023