Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
research:jtransformer:api:java:pefs:4.0:constructort [2015/04/27 13:43]
127.0.0.1 external edit
research:jtransformer:api:java:pefs:4.0:constructort [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
 +----
 +
 +=== constructorT(#​id,​ #class, [#​param_1,​...],​ [#​exception_1,​...],​ [#​typeparam_1,​...],​ #​body) ​ ===
 +
 +Represents the constructor declaration.
 +
 +Added in JT 2.8: Up to 2.8.0 it was part of [[..:​old:​methoddeft|methodDefT]].
 +
 +=== Arguments ===
 +== ==
 +**#id:** id\\ 
 +the unique ID assigned to this fact.
 +
 +**#class:** [[classt|classT]]\\ ​
 +ID of the parent/​declaring class.
 + 
 +**[#​param_1,​...]:​** [[paramt|paramT]]\\ ​
 +list of IDs of the method parameters.
 + 
 +**[#​exception_1,​...]:​** [[classT|classT]],​ [[typeParamT|typeParamT]]\\ ​
 +list of IDs of the thrown exceptions.
 +
 +**[#​typeparam_1,​...]:​** [[typeParamT|typeParamT]]\\ ​
 +list of IDs of the type parameters.
 + 
 +**#body:** [[blockt|blockT]],​ null\\ ​
 +ID of the block.
 +
 +=== Sample Java Source ===
 +== ==
 +<Code lang-java>​
 +class Object ​ {   
 + public Object(String name) {            //​Constructor
 +                 ...
 + }
 +        ...                                                       
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +==  ==
 +<Code lang-prolog>​
 +classT(#​class,​ #​compilationUnit,​ '​Object',​ [..., #const]).
 +constructorT(#​const,​ #class, [#param], [], [], #body).
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_type_spec(constructorT,​[
 +    ast_arg(id, ​     mult(1,1,no ), id,  [constructorT]),​
 +    ast_arg(parent, ​ mult(1,1,no ), id,  [classT]), ​
 +    ast_arg(params, ​ mult(0,​*,​ord),​ id,  [paramT]),
 +    ast_arg(excepts,​ mult(0,​*,​ord),​ id,  [classT, typeParamT]),​
 +    ast_arg(paramRef,​mult(1,​*,​ord ),id,  [typeParamT]), ​     ​
 +    ast_arg(body, ​   mult(0,​1,​no), ​ id,  [blockT,​nullType])
 +]).
 +</​Code>​
  
research/jtransformer/api/java/pefs/4.0/constructort.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019