D2.2: Static Analysis Techniques for AIR Generation

In this report we describe the developed techniques for static analysis of REPARA-C++ source code and for producing REPARA-AIR representations. This means that we developed a command line tool, called RCPP2AIR, whose input is a REPARA-C++ compilation unit. It analyses the input and builds the REPARA-AIR representation (Abstract Intermediate Representation of the source code) definned in the REPARA-C++ Open Specification and saves it into an .air file, which is its binary representation. The AIR access library (D4.2 [3] developed in T4.1) provides a Java API so the results can be used easily for any purpose, for example code metrics calculation. To provide a more general utilization of the analysis result, we developed a tool that transforms the REPARA-AIR representation stored in binary form to JSON format which is a wide-spread, well-structured representation, so the results can be used also without the AIR access library.

The aim of REPARA-AIR is to represent the original C++ source code as it is in the source file, but some algorithms need more detailed and REPARA-specic information. For this purpose, we developed the attribute parser library which transforms the original low level detailed attribute representation into a higher level REPARA-specific one. The AIR2ReparaAttributes tool uses this library to export REPARA-specic attributes to JSON format (in human readable form). Additionally, we developed the CFG builder library which builds a control flow graph (CFG) from the REPARA-AIR representation. The AIR2CFG tool exports the built CFG into JSON and GraphML format. While AIR2ReparaAttributes and AIR2CFG use the corresponding library only to export the results in a standard and/or human readable form, the AIR2Metrics tool uses these libraries for enhanced metrics calculation.
In this document we present the architecture of the tool-chain (libraries and tools) mentioned above. We describe how these libraries and tools relate to each other, what are their input and output les, what are their main command line options and how can they be used. To help understanding how they work and what they create, all different kinds of outputs will be demonstrated on small examples.

The tool-chain was successfully tested in a real industrial environment (i.e. on the use cases provided by the REPARA industrial partners).


Comments are closed.