To get a trial key
fill out the form below
Team License (a basic version)
Enterprise License (an extended version)
* By clicking this button you agree to our Privacy Policy statement

Request our prices
New License
License Renewal
--Select currency--
* By clicking this button you agree to our Privacy Policy statement

Free PVS-Studio license for Microsoft MVP specialists
* By clicking this button you agree to our Privacy Policy statement

To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

I am interested to try it on the platforms:
* By clicking this button you agree to our Privacy Policy statement

Message submitted.

Your message has been sent. We will email you at

If you haven't received our response, please do the following:
check your Spam/Junk folder and click the "Not Spam" button for our message.
This way, you won't miss messages from our team in the future.

How VivaCore library appeared

How VivaCore library appeared

Aug 10 2008

The article describes the main preconditions and stages of development of open VivaCore library intended for code analysis and creation of metaprogramming systems. VivaCore project is a development of OpenC++ library in which support of C and C++ language peculiarities specific for Visual Studio 2005/2008 is implemented.


This article is intended for software developers who use or plan to use VivaCore library in their developments. The article touches upon the history of creating VivaCore library and relating peculiarities of the library's implementation.

VivaCore library is a project with open program code built on the basis of an older library OpenC++ (OpenCxx). VivaCore library is implemented in C++ and meant to be used in VisualStudio 2005/2008 environment.

VivaCore library was created and continues to develop thanks to OOO "Program Verification Systems". VivaCore code analysis library has a State Computer program certificate N 2008610480.

You can use VivaCore library free. The only license limitation concerning it is the necessity to mention that your project has been developed on the basis of OpenC++ library and its development VivaCore.

The library is used to develop projects in which analysis of source code of C and C++ programs is performed. Such an example is systems of language syntax extension, code editing and coloring systems, static analyzers, systems of building documentation on the code. To learn more about the library and possible ways to use it see article "The essence of the code analysis library VivaCore" [1].

VivaCore library as part of Viva64 product

Creation of VivaCore has never been planned purposely but it appeared in an absolutely natural way while working on Viva64 project. Viva64 product is a specialized tool for testing source code of C/C++ programs to establish if they are compatible with 64-bit platforms [2]. Viva64 is a typical static code analyzer meant to help programmers while developing 64-bit applications.

Of course, an essential part of Viva64 project is the system of parsing source code of programs for further analysis. OpenC++ (OpenCxx) was used as a library for code parsing. On the initial stage of Viva64 product's development its inner structure was as shown on Picture 1.


Picture 1. How we imagined Viva64 project's structure to look.

As seen from the picture there was the code of Viva64 project which used functionality of OpenC++ library inside it.

But it became clear already at early stages of implementation that OpenC++ library doesn't implement the whole necessary functionality, contains some disappointing errors and doesn't support fully key words used in Visual C++ compiler. This was the stimulus to develop new functionality and improve OpenC++ library.

Let's give some examples of improvements. C language support was implemented (OpenC++ works only with C++ code) as well as calculation of values of literal constants. Specific key words __noop, __if_exists, __ptr32 became supported too. And so on.

As the result of these changes, large code has been written which related to a code analysis library in its meaning, but it was implemented in Viva64's code. Because of it Viva64's architecture looked as shown on Picture 2.


Picture 2. Implementation of functionality relating to C/C++ code parsing in Viva64.

It became evident that some functionality relating to code parsing should be enclosed into a separate module. Thus VivaCore library appeared. Although its code was still inside Viva64 project, it was separated logically. Viva64's structure became as shown on Picture 3.


Picture 3. A decision is made to enclose functionality relating to C/C++ code parsing into a separate library VivaCore.

The new architecture where code parsing functionality was enclosed into a separate subsystem VivaCore was convenient for us. But we decided to go further.

VivaCore library's independent life

We decided to provide other developers with an opportunity to use new abilities implemented within the framework of VivaCore. It turned out to be too difficult a task to update OpenC++ library up to the necessary level. That's why we decided simply to make VivaCore library a separate project (Picture 4) and put it on OOO "Program Verification Systems" site. You can download source code of VivaCore library here.


Picture 4. Viva64's new structure.

Now VivaCore library can be used not only within the framework of OOO "Program Verification Systems" projects such as Viva64, VivaMP, but in projects of third-party developers as well (Picture 5).


Picture 5. Open library VivaCore for developing projects dealing with source C/C++ code.

Besides VivaCore library itself developers can download a demo program VivaVisualCode [3]. It shows some abilities of VivaCore library by an example of graphic representation of a parse tree. An example of such a tree is shown on Picture 6.


Picture 6. Parse tree for expression "const bool is64bitInt = sizeof(int) == 8;".

Peculiarities of the library relating to the history of its development

As VivaCore library has been developed as part of Viva64 project it was reflected in some peculiarities of its implementation. These peculiarities are:

  • Accurate diagnosis of syntax errors in program text was sacrificed to the ability of processing as much code as possible. In case of parsing of code with the purpose to perform its static analysis or some other processing (for example, coloring) it is more important to process as much text as possible ignoring errors met. To detect syntax errors a compiler is used. VivaCore library supposes that the code is correct. If it is not, it tries to ignore an incorrect section and starts parsing at the next correct construction. It is useful if the code is incomplete or contains new unknown key words or too complex constructions based on generic classes. However, nothing prevents the user from inserting corresponding processors of incorrect input data.
  • Garbage Collector mechanism is not implemented in OpenC++. VivaCore library has the same problem. As the result, while working VivaCore is constantly allocating memory without returning it. It is not critically for Viva64 analyzer because it is launched for each file separately. If a developer needs to work with the library for a long time, he will have to implement the missing functionality.
  • The library is optimized for working on 64-bit systems.
  • There is no integral documentation. However, it is absent in OpenC++ as well. That's why developers must be ready to spend some time on mastering it. Contact us if you have any questions. We'll try to help you.
  • The library contains some functions which don't take part in the very code parsing but are necessary for Viva64 and VivaMP projects.


I hope this article will help you to decide whether you should use VivaCore library in your projects. If you are not sure - write. We'll try to provide you with additional information and answer your questions.


Popular related articles
PVS-Studio ROI

Date: Jan 30 2019

Author: Andrey Karpov

Occasionally, we're asked a question, what monetary value the company will receive from using PVS-Studio. We decided to draw up a response in the form of an article and provide tables, which will sho…
Appreciate Static Code Analysis!

Date: Oct 16 2017

Author: Andrey Karpov

I am really astonished by the capabilities of static code analysis even though I am one of the developers of PVS-Studio analyzer myself. The tool surprised me the other day as it turned out to be sma…
The Evil within the Comparison Functions

Date: May 19 2017

Author: Andrey Karpov

Perhaps, readers remember my article titled "Last line effect". It describes a pattern I've once noticed: in most cases programmers make an error in the last line of similar text blocks. Now I want t…
Static analysis as part of the development process in Unreal Engine

Date: Jun 27 2017

Author: Andrey Karpov

Unreal Engine continues to develop as new code is added and previously written code is changed. What is the inevitable consequence of ongoing development in a project? The emergence of new bugs in th…
Characteristics of PVS-Studio Analyzer by the Example of EFL Core Libraries, 10-15% of False Positives

Date: Jul 31 2017

Author: Andrey Karpov

After I wrote quite a big article about the analysis of the Tizen OS code, I received a large number of questions concerning the percentage of false positives and the density of errors (how many erro…
The way static analyzers fight against false positives, and why they do it

Date: Mar 20 2017

Author: Andrey Karpov

In my previous article I wrote that I don't like the approach of evaluating the efficiency of static analyzers with the help of synthetic tests. In that article, I give the example of a code fragment…
PVS-Studio for Java

Date: Jan 17 2019

Author: Andrey Karpov

In the seventh version of the PVS-Studio static analyzer, we added support of the Java language. It's time for a brief story of how we've started making support of the Java language, how far we've co…
How PVS-Studio Proved to Be More Attentive Than Three and a Half Programmers

Date: Oct 22 2018

Author: Andrey Karpov

Just like other static analyzers, PVS-Studio often produces false positives. What you are about to read is a short story where I'll tell you how PVS-Studio proved, just one more time, to be more atte…
The Last Line Effect

Date: May 31 2014

Author: Andrey Karpov

I have studied many errors caused by the use of the Copy-Paste method, and can assure you that programmers most often tend to make mistakes in the last fragment of a homogeneous code block. I have ne…
The Ultimate Question of Programming, Refactoring, and Everything

Date: Apr 14 2016

Author: Andrey Karpov

Yes, you've guessed correctly - the answer is "42". In this article you will find 42 recommendations about coding in C++ that can help a programmer avoid a lot of errors, save time and effort. The au…

Comments (0)

Next comments
This website uses cookies and other technology to provide you a more personalized experience. By continuing the view of our web-pages you accept the terms of using these files. If you don't want your personal data to be processed, please, leave this site.
Learn More →