Differences

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

Link to this comparison view

research:jtransformer:api:java:pefs:4.2:newt [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
  
 +----
 +=== newT (#id, #parent, #encl, #receiver, [#​arg_1,​...],​ #​constructor,​ [#​typeparam_1,​...],​ #type, #​anonClDef) ​ ===
 +
 +Represents the class instance creation expression.
 +
 +== History ==
 +  * JTransformer 4.0: Renamed from newClassT to newT
 +
 +=== 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.
 +
 +**#​receiver:​** [[plastexpression|expression]],​ null\\ ​
 +Receiver of the constructor invocation
 +
 +**[#​arg_1,​...]:​** [[plastexpression|expression]]\\ ​
 +list of argument expressions in this class instance creation expression.\\ ​
 +
 +**#​constructor:​** [[constructort|constructorT]],​ null\\ ​
 +ID of the constructor invoked by this expression.
 +If the referenced constructor is a anonymous class constructor #​constructor is '​null'​.\\
 +
 +**[#​typeparam_1,​...]:​** [[type_inst]],​ [[wildcardt|wildcardT]]\\ ​
 +list of type parameters. ​
 +
 +**#type:** [[parameterizedtypet|parameterizedTypeT]],​ [[classt|classT]]\\
 +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.
 +
 +=== Sample Java Code ===
 +==  ==
 +<Code lang-java>​
 +void myFunction(){
 + String myString = new String();
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +==  ==
 +<Code lang-prolog>​
 +methodT(Method,​ ..., '​myFunction',​ ...),
 +localT(Local,​ _, Method, RefToString,​ '​myString',​ New),
 +newT(New, Local, Method, null, [], RefToConstructor,​ [], RefToString,​ null).
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_type_spec(newT,​[
 +     ​ast_arg(id, ​        ​mult(1,​1,​no ), id,  [newT]),
 +     ​ast_arg(parent, ​    ​mult(1,​1,​no ), id,  [id]),
 +     ​ast_arg(encl, ​      ​mult(1,​1,​no ), id,  [methodT, constructorT,​ classInitializerT,​fieldT]),​
 +     ​ast_arg(receiver, ​  ​mult(0,​1,​no), ​ id,  [expressionType,​nullType]),​
 +     ​ast_arg(args, ​      ​mult(0,​*,​ord),​ id,  [expressionType]),​
 +     ​ast_arg(constr, ​    ​mult(0,​1,​no), ​ id,  [constructorT,​nullType]),​
 +     ​ast_arg(typeParams,​ mult(0,​*,​ord),​ id,  [type_inst, wildcardT]),​
 +     ​ast_arg(type, ​      ​mult(0,​1,​no), ​ id,  [parameterizedTypeT,​classT]),​
 +     ​ast_arg(anonClDef, ​ mult(0,​1,​no), ​ id,  [classT,​nullType])
 +]).
 +</​Code>​
research/jtransformer/api/java/pefs/4.2/newt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019