SDA SE Wiki

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

User Tools

Site Tools



throwT (#id, #parent, #encl, #expr)

Represents the throw statement.

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.

#expr: expression
ID of the exception.

Sample Java Source

void myArrayAccess(int i) throws MyException{
	if (i > 2){
		throw new MyException("index out of range");            // corresponding code line to throwT
	}
}

Its PEF Representation

throwT(#id, #parent, #enclMethod, #expr).
blockT(#parent, ..., #enclMethod, [#id]).
methodT(#enclMethod, ..., 'myArrayAccess', [V8], type(basic, void, 0), ..., ...).
newClassT(#expr, #id, #enclMethod, ..., ..., ..., 'null', 'null').

AST Specification

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

SEWiki, © 2025