Differences

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

Link to this comparison view

Next revision
Previous revision
research:jtransformer:api:java:pefs:3.0:newclasst [2013/11/15 01:49]
127.0.0.1 external edit
research:jtransformer:api:java:pefs:3.0:newclasst [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
  
 +----
 +
 +=== newClassT (#id, #parent, #encl, #​constructor,​ [#​arg_1,​...],​ #type, #anonClDef, #​encltype) ​ ===
 +
 +Represents the class instance creation expression.
 +
 +=== Arguments ===
 +== ==
 +**#id:** id\\ 
 +the unique ID assigned to this fact.
 +
 +**#​parent:​** id\\ 
 +ID of the parent node.
 +
 +**#​encl:​** ​ [[methodT|methodT]],​ [[constructorT|constructorT]],​ [[classInitializerT|classInitializerT]],​ [[fieldt|fieldT]]\\ ​
 +ID of the fact that represents the enclosing element.
 +
 +**#​constructor:​** [[constructorT|constructorT]],​ null\\ ​
 +ID of the constructor invoked by this expression.
 +If the referenced constructor is a anonymous class constructor #​constructor is '​null'​.\\
 +
 +**[#​arg_1,​...]:​** [[plastexpression|expression]]\\ ​
 +list of argument expressions in this class instance creation expression.\\ ​
 +
 +**#type:** [[parameterizedtypet|parameterizedTypeT]],​ [[typereft|typeRefT]]\\
 +ID of the fact referencing the class instantiated by this constructor call. <- ++ Changed in JTransformer 2.6.0 | was ID of an [[identt|identt]] or [[selectt|selectt]][[#​refnewclasst1|[1]]] fact, representing a simple type name or a full qualified type name respectively. ​ ++
 +
 +**#​anonClDef:​** [[classt|classT]],​ null\\ ​
 +the anonymous class declaration introduced by this class instance creation expression, if it has one.
 +
 +**#​encltype:​** [[plastexpression|expression]],​ null\\
 +ID of the inner or member class constructor or ID of the anonymous class.
 +
 +=== Sample Java Code ===
 +==  ==
 +<Code lang-java>​
 +void myFunction(){
 + String mySting = new String();
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +==  ==
 +<Code lang-prolog>​
 +methodT(#​encl,​ ..., '​myFunction',​ [], #​returntype,​ [], ...).
 +localT(#​parent,​ ..., #encl, #localtype, '​mySting',​ #id).
 +newClassT(#​id,​ #parent, #encl, #​constructor,​ [], #typeref, '​null',​ '​null'​).
 +typeRefT(#​typeref,​ ..., ..., #classid).
 +classT(#​classid,​ ..., '​String',​ ...).
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_def('​Java',​newClassT,​[
 +     ​ast_arg(id, ​       mult(1,1,no ), id, [newClassT]),​ % <-- convention!!!
 +     ​ast_arg(parent, ​   mult(1,1,no ), id, [id]), % <-- convention!!!
 +     ​ast_arg(encl, ​     mult(1,1,no ), id, [methodT, constructorT,​ classInitializerT,​ fieldT]),
 +     ​ast_arg(constr, ​   mult(0,​1,​no), ​ id, [constructorT,​ nullType]),
 +     ​ast_arg(args, ​     mult(0,​*,​ord),​ id, [expressionType]),​
 +     ​ast_arg(ref, ​      ​mult(0,​1,​no), ​ id, [parameterizedTypeT,​typeRefT]),​
 +     ​ast_arg(anonClDef,​ mult(0,​1,​no), ​ id, [classT, nullType]),
 +     ​ast_arg(encltype, ​ mult(0,​1,​no), ​ id, [expressionType,​ nullType])
 +]).
 +</​Code>​
research/jtransformer/api/java/pefs/3.0/newclasst.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019