Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

This resource has not currently been approved, and is not currently linked to from our directory of resources. It is being displayed here for preview by the author and moderators only.
Rated
Read 275 times

Contents

Related Categories

The use of the code analysis library OpenC++: modifications, improvements, error corrections - Introduction.

AndreyKarpov

Introduction.

One may often here in forums that there are a lot of C++ syntax analyzers ("parsers"), and many of them are free. Or that one may take YACC, for example, and realize his own analyzer easily. Don't believe, it is not so easy [1, 2]. One may understand it especially if one remembers that it is even not half a task to parse syntax. It is necessary to realize structures for storing the program tree and semantic tables containing information about different objects and their scopes. It is especially important while developing specialized applications related to the processing and static analysis of C++ code. It is necessary for their realization to save the whole program tree what may be provided by few libraries. One of them is open library OpenC++ (OpenCxx) [3] about which we'll speak in this article.

We'd like to help developers in mastering OpenC++ library and share our experience of modernization and improvement of some defects. The article is a compilation of pieces of advice, each of which is devoted to correction of some defect or realization of improvement.

The article is based on recollections about changes that were carried out in VivaCore library [4] based on OpenC++. Of course, only a small part of these changes is discussed here. It is a difficult task to remember and describe them all. And, for example, description of addition of C language support into OpenC++ library will take too much place. But you can always refer to original texts of VivaCore library and get a lot of interesting information.

It remains to say that OpenC++ library is unfortunately out-of-date now and needs serious improvement for supporting the modern C++ language standard. That's why if you are going to realize a modern compiler for example, you'd better pay your attention to GCC or to commercial libraries [5, 6]. But OpenC++ still remains a good and convenient tool for many developers in the sphere of systems of specialized processing and modification of program code. With the use of OpenC++ many interesting solutions are developed, for example, execution environment OpenTS [7] for T++ programming language (development of Program systems Institution RAS), static code analyzer Viva64 [8] or Synopsis tool for preparing documentation on the original code [9].

The purpose of the article is to show by examples how one can modify and improve OpenC++ library code. The article describes 15 library modifications related to error correction or addition of new functionality. Each of them not only allows to make OpenC++ library better but also gives an opportunity to study its work principles deeper. Let's get acquainted with them.

Comments