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

Both sides previous revision Previous revision
Next revision
Previous revision
research:jtransformer:api:java:pefs:4.0:preserve_qualifiednamet [2014/08/13 13:31]
127.0.0.1 external edit
research:jtransformer:api:java:pefs:4.0:preserve_qualifiednamet [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
  
 +----
 +=== preserve_qualifiedNameT(#​id,​ #type, '​kind',​ [#​headType1,​ ...]) ===
 +This fact is used for preserving the original appearance of the source code after transformations. It declares, that the type name should be qualified. It can be either fully qualified or partially qualified (in case of using inner classes).
 +
 +<Code lang-java>​
 +java.lang.String s;
 +</​Code>​
 +
 +instead of 
 +
 +<Code lang-java>​
 +String s;
 +</​Code>​
 +
 +== History ==
 +  * JTransformer 3.0: Added as srcQualifiedT
 +  * JTransformer 4.0: Renamed to preserve_qualifiedNameT
 +
 +=== Arguments ===
 +== ==
 +**id:** id\\
 +ID of the corresponding element\\
 +**type:** [[type_inst]]\\
 +The corresponding type (can differ from element type in case of parameterized types)\\
 +**kind:** ''​full''​ | ''​partial''​\\
 +Either ''​full''​ (for fully qualified names) or ''​partial''​ (for partially qualified names)\\
 +**headType:​** [[[packageT|packageT]],​ [[classT|classT]],​ null\\
 +List of elements of the qualified name (or null in case of fully qualified name)
 +    ​
 +===Sample Java Source===
 +== ==
 +<Code lang-java>​
 +java.lang.String s;           // fully qualified
 +</​Code>​
 +===Its PEF Representation ===
 +== ==
 +<Code lang-prolog>​
 +fieldT(#​Field,​ ..., #String, '​s',​ null).
 +preserve_qualifiedNameT(#​Field,​ #String, full, null).
 +</​Code>​
 +
 +===Advanced Sample Java Source===
 +== ==
 +<Code lang-java>​
 +InnerClass.InnerInnerClass c1;                              // partially qualified
 +...
 +preserve.QualifiedName.InnerClass.InnerInnerClass c2;       // fully qualified
 +</​Code>​
 +===Its PEF Representation ===
 +== ==
 +<Code lang-prolog>​
 +fieldT(#​Field1,​ ..., #​InnerInnerClass,​ '​c1',​ null).
 +preserve_qualifiedNameT(#​Field1,​ #​InnerInnerClass,​ partial, [#​InnerInnerClass,​ #​InnerClass]).
 +...
 +fieldT(#​Field2,​ ..., #​InnerInnerClass,​ '​c2',​ null).
 +preserve_qualifiedNameT(#​Field2,​ #​InnerInnerClass,​ full, null).
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_relation_type_spec(preserve_qualifiedNameT,​[
 +    ast_arg(id, ​      ​mult(1,​1,​no ), id,   ​[id]),​
 +    ast_arg(type, ​    ​mult(1,​1,​no ), id,   ​[type_inst]),​
 +    ast_arg(kind, ​    ​mult(1,​1,​no ), attr, [atomic]),
 +    ast_arg(headType,​ mult(0,*,no ), id,   ​[packageT,​ classT, nullType])
 +]).
 +</​Code>​
research/jtransformer/api/java/pefs/4.0/preserve_qualifiednamet.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019