SlideShare una empresa de Scribd logo
1 de 7
Descargar para leer sin conexión
How VivaCore library appeared
Author: Andrey Karpov

Date: 10.08.2008


Abstract
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.


Introduction
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: http://www.viva64.com/vivacore-library/download/.
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:

    1. 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.
    2. 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.
    3. The library is optimized for working on 64-bit systems.
    4. 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.
    5. The library contains some functions which don't take part in the very code parsing but are
       necessary for Viva64 and VivaMP projects.
Conclusion
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.


References
    1. Andrey Karpov, Evgeniy Ryzhkov. The essence of the code analysis library VivaCore.
       http://www.viva64.com/art-2-2-449187005.html
    2. Evgeniy Ryzhkov. Viva64: working up of 64-bit applications.
    3. http://www.viva64.com/art-1-2-206176447.html
    4. Andrey Karpov. Description of VivaVisualCode. http://www.viva64.com/art-2-2-
       1281792295.html

Más contenido relacionado

Destacado

Prototyping is an attitude
Prototyping is an attitudePrototyping is an attitude
Prototyping is an attitudeWith Company
 
50 Essential Content Marketing Hacks (Content Marketing World)
50 Essential Content Marketing Hacks (Content Marketing World)50 Essential Content Marketing Hacks (Content Marketing World)
50 Essential Content Marketing Hacks (Content Marketing World)Heinz Marketing Inc
 
10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer ExperienceYuan Wang
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanPost Planner
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionIn a Rocket
 
20 Ideas for your Website Homepage Content
20 Ideas for your Website Homepage Content20 Ideas for your Website Homepage Content
20 Ideas for your Website Homepage ContentBarry Feldman
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting PersonalKirsty Hulse
 

Destacado (7)

Prototyping is an attitude
Prototyping is an attitudePrototyping is an attitude
Prototyping is an attitude
 
50 Essential Content Marketing Hacks (Content Marketing World)
50 Essential Content Marketing Hacks (Content Marketing World)50 Essential Content Marketing Hacks (Content Marketing World)
50 Essential Content Marketing Hacks (Content Marketing World)
 
10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media Plan
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
 
20 Ideas for your Website Homepage Content
20 Ideas for your Website Homepage Content20 Ideas for your Website Homepage Content
20 Ideas for your Website Homepage Content
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting Personal
 

Similar a How VivaCore library appeared

The essence of the VivaCore code analysis library
The essence of the VivaCore code analysis libraryThe essence of the VivaCore code analysis library
The essence of the VivaCore code analysis libraryPVS-Studio
 
VivaCore - Quick Start
VivaCore - Quick StartVivaCore - Quick Start
VivaCore - Quick StartPVS-Studio
 
Viva64: What Is It, and Who Is It for?
Viva64: What Is It, and Who Is It for?Viva64: What Is It, and Who Is It for?
Viva64: What Is It, and Who Is It for?PVS-Studio
 
Description of VivaVisualCode
Description of VivaVisualCodeDescription of VivaVisualCode
Description of VivaVisualCodePVS-Studio
 
Viva64: working up of 64-bit applications
Viva64: working up of 64-bit applicationsViva64: working up of 64-bit applications
Viva64: working up of 64-bit applicationsPVS-Studio
 
Bugs Found by LibreOffice in PVS-Studio
Bugs Found by LibreOffice in PVS-StudioBugs Found by LibreOffice in PVS-Studio
Bugs Found by LibreOffice in PVS-StudioPVS-Studio
 
How to add ar effects to an android app using vr face library
How to add ar effects to an android app using vr face library How to add ar effects to an android app using vr face library
How to add ar effects to an android app using vr face library Moon Technolabs Pvt. Ltd.
 
64 bits, Wp64, Visual Studio 2008, Viva64 and all the rest...
64 bits, Wp64, Visual Studio 2008, Viva64 and all the rest...64 bits, Wp64, Visual Studio 2008, Viva64 and all the rest...
64 bits, Wp64, Visual Studio 2008, Viva64 and all the rest...Andrey Karpov
 
Top React Native Developer Tools and Component Libraries (For Easy and Speedy...
Top React Native Developer Tools and Component Libraries (For Easy and Speedy...Top React Native Developer Tools and Component Libraries (For Easy and Speedy...
Top React Native Developer Tools and Component Libraries (For Easy and Speedy...Katy Slemon
 
Jasper report dependencies [by sc]
Jasper report dependencies [by sc]Jasper report dependencies [by sc]
Jasper report dependencies [by sc]santi caltabiano
 
outgoing again
outgoing againoutgoing again
outgoing againspredslide
 
Starting with OpenCV on i.MX 6 Processors
Starting with OpenCV on i.MX 6 ProcessorsStarting with OpenCV on i.MX 6 Processors
Starting with OpenCV on i.MX 6 ProcessorsToradex
 
PVS-Studio advertisement - static analysis of C/C++ code
PVS-Studio advertisement - static analysis of C/C++ codePVS-Studio advertisement - static analysis of C/C++ code
PVS-Studio advertisement - static analysis of C/C++ codePVS-Studio
 
PVS-Studio advertisement - static analysis of C/C++ code
PVS-Studio advertisement - static analysis of C/C++ codePVS-Studio advertisement - static analysis of C/C++ code
PVS-Studio advertisement - static analysis of C/C++ codeAndrey Karpov
 
[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...
[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...
[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...Kobkrit Viriyayudhakorn
 
Create a PHP Library the right way
Create a PHP Library the right wayCreate a PHP Library the right way
Create a PHP Library the right wayChristian Varela
 

Similar a How VivaCore library appeared (20)

The essence of the VivaCore code analysis library
The essence of the VivaCore code analysis libraryThe essence of the VivaCore code analysis library
The essence of the VivaCore code analysis library
 
VivaCore - Quick Start
VivaCore - Quick StartVivaCore - Quick Start
VivaCore - Quick Start
 
VivaCore FAQ
VivaCore FAQVivaCore FAQ
VivaCore FAQ
 
Viva64: What Is It, and Who Is It for?
Viva64: What Is It, and Who Is It for?Viva64: What Is It, and Who Is It for?
Viva64: What Is It, and Who Is It for?
 
Description of VivaVisualCode
Description of VivaVisualCodeDescription of VivaVisualCode
Description of VivaVisualCode
 
Viva64: working up of 64-bit applications
Viva64: working up of 64-bit applicationsViva64: working up of 64-bit applications
Viva64: working up of 64-bit applications
 
Bugs Found by LibreOffice in PVS-Studio
Bugs Found by LibreOffice in PVS-StudioBugs Found by LibreOffice in PVS-Studio
Bugs Found by LibreOffice in PVS-Studio
 
How to add ar effects to an android app using vr face library
How to add ar effects to an android app using vr face library How to add ar effects to an android app using vr face library
How to add ar effects to an android app using vr face library
 
64 bits, Wp64, Visual Studio 2008, Viva64 and all the rest...
64 bits, Wp64, Visual Studio 2008, Viva64 and all the rest...64 bits, Wp64, Visual Studio 2008, Viva64 and all the rest...
64 bits, Wp64, Visual Studio 2008, Viva64 and all the rest...
 
Top React Native Developer Tools and Component Libraries (For Easy and Speedy...
Top React Native Developer Tools and Component Libraries (For Easy and Speedy...Top React Native Developer Tools and Component Libraries (For Easy and Speedy...
Top React Native Developer Tools and Component Libraries (For Easy and Speedy...
 
Jasper report dependencies [by sc]
Jasper report dependencies [by sc]Jasper report dependencies [by sc]
Jasper report dependencies [by sc]
 
outgoing again
outgoing againoutgoing again
outgoing again
 
CASCON 2017 - OpenAPI v3
CASCON 2017 - OpenAPI v3CASCON 2017 - OpenAPI v3
CASCON 2017 - OpenAPI v3
 
Starting with OpenCV on i.MX 6 Processors
Starting with OpenCV on i.MX 6 ProcessorsStarting with OpenCV on i.MX 6 Processors
Starting with OpenCV on i.MX 6 Processors
 
PVS-Studio advertisement - static analysis of C/C++ code
PVS-Studio advertisement - static analysis of C/C++ codePVS-Studio advertisement - static analysis of C/C++ code
PVS-Studio advertisement - static analysis of C/C++ code
 
64-bit Loki
64-bit Loki64-bit Loki
64-bit Loki
 
PVS-Studio advertisement - static analysis of C/C++ code
PVS-Studio advertisement - static analysis of C/C++ codePVS-Studio advertisement - static analysis of C/C++ code
PVS-Studio advertisement - static analysis of C/C++ code
 
[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...
[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...
[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...
 
Create a PHP Library the right way
Create a PHP Library the right wayCreate a PHP Library the right way
Create a PHP Library the right way
 
React js basics
React js basicsReact js basics
React js basics
 

Último

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 

Último (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

How VivaCore library appeared

  • 1. How VivaCore library appeared Author: Andrey Karpov Date: 10.08.2008 Abstract 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. Introduction 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.
  • 2. 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.
  • 3. 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: http://www.viva64.com/vivacore-library/download/.
  • 4. 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).
  • 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.
  • 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: 1. 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. 2. 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. 3. The library is optimized for working on 64-bit systems. 4. 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. 5. The library contains some functions which don't take part in the very code parsing but are necessary for Viva64 and VivaMP projects.
  • 7. Conclusion 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. References 1. Andrey Karpov, Evgeniy Ryzhkov. The essence of the code analysis library VivaCore. http://www.viva64.com/art-2-2-449187005.html 2. Evgeniy Ryzhkov. Viva64: working up of 64-bit applications. 3. http://www.viva64.com/art-1-2-206176447.html 4. Andrey Karpov. Description of VivaVisualCode. http://www.viva64.com/art-2-2- 1281792295.html