SDA SE Wiki

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

User Tools

Site Tools



preserve_inlineDeclarationT(#firstField, [#otherField1, ...])

This fact is used for preserving the original appearance of the source code after transformations. It declares that multiple variables are declared in a single declaration, being written as

int i, j, k; 

instead of

int i;
 int j;
 int k; 
History
  • JTransformer 2.9: Added as inlineDeclarationT
  • JTransformer 4.0: Renamed to preserve_inlineDeclarationT

Arguments

#firstField: fieldT, localT
ID of the first variable.

[#otherField1, …]: fieldT, localT
list of IDs of other variables. These facts are marked with an omit_fieldT fact.

Sample Java Source

...
int i, j, k;
...

Its PEF Representation

fieldT(FirstField,  Parent, Type, 'i', null).
fieldT(SecondField, Parent, Type, 'j', null).
fieldT(ThirdField,  Parent, Type, 'k', null).
preserve_inlineDeclarationT(FirstField, [SecondField, ThirdField]).
omit_fieldT(SecondField, FirstField).
omit_fieldT(ThirdField, FirstField).

AST Specification

ast_relation_type_spec(preserve_inlineDeclarationT,[
     ast_arg(id,   mult(1,1,no ),  id,  [fieldT, localT]), 
     ast_arg(ref,  mult(1,*,ord ), id,  [fieldT, localT]) 
]).
research/jtransformer/api/java/pefs/4.2/preserve_inlinedeclarationt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019