SDA SE Wiki

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

User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

research:jtransformer:api:java:pefs:3.0:throwt [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
 +----
  
 +=== 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|methodT]],​ [[constructorT|constructorT]],​ [[classInitializerT|classInitializerT]]\\ ​
 +ID of the enclosing element.
 +
 +**#expr:** [[plastexpression|expression]]\\ ​
 +ID of the exception.
 +
 +=== Sample Java Source ===
 +== ==
 +<Code lang-java>​
 +void myArrayAccess(int i) throws MyException{
 + if (i > 2){
 + throw new MyException("​index out of range"​); ​           // corresponding code line to throwT
 + }
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +== ==
 +<Code lang-prolog>​
 +throwT(#id, #parent, #​enclMethod,​ #expr).
 +blockT(#​parent,​ ..., #​enclMethod,​ [#id]).
 +methodT(#​enclMethod,​ ..., '​myArrayAccess',​ [V8], type(basic, void, 0), ..., ...).
 +newClassT(#​expr,​ #id, #​enclMethod,​ ..., ..., ..., '​null',​ '​null'​).
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +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])
 +]).
 +</​Code>​
research/jtransformer/api/java/pefs/3.0/throwt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019