SDA SE Wiki

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

User Tools

Site Tools



omit_arrayDeclarationT(#id)

This fact is only used for preserving the original appearance of the source code after transformations. It declares that an array initialization (represented by a newArrayT fact) omits the explicit array instantiation in the orginal source code, being written as

int[] a = {1,2,3}; 

instead of

int[] a = new int[] {1,2,3} 
History
  • JTransformer 4.0: Renamed from omitArrayDeclarationT to preserve_omitArrayDeclarationT
  • JTransformer 4.1: Renamed to omit_arrayDeclarationT

Arguments

#id: newArrayT
ID of the newArrayT element.

Sample Java Source

int[] a = {1,2,3}; 

Its PEF Representation

fieldT(Field, _, _, 'a', NewArray),
newArrayT(NewArray, Field, Field, [], [Entry1, Entry2, Entry3], _),
literalT(Entry1, NewArray, Field, IntType, '1'),
literalT(Entry2, NewArray, Field, IntType, '2'),
literalT(Entry3, NewArray, Field, IntType, '3'),
omit_arrayDeclarationT(NewArray).

AST Specification

ast_relation_type_spec(omit_arrayDeclarationT,[
     ast_arg(id,     mult(1,1,no ), id,   [newArrayT]) 
]).
research/jtransformer/api/java/pefs/4.2/omit_arraydeclarationt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019