cppp - a C++ parser

cppp is a parser for C++ as defined by the grammar summary in Annex A of the ISO/IEC 14882-1998 standard which describes the C++ programming language.

As such the parser accepts a superset of valid C++ constructs. For example access control, ambiguity nor type rules are controlled. Only syntactical correctness is checked. The good news is that all valid C++ source code will (eventually) be accepted by cppp. But on the other hand, not all invalid C++ source code will be rejected. For example

int f()
{
   int f;
   int f;
}

is invalid C++ code that cppp accepts.

cppp builds a grammar tree which reflects the source code. An example is included which dumps this grammar tree to an XML document. (See the output in the samples directory)

Progress on cppp is slow. Here is an overview. Items correspond to paragraphs in annex A of the ISO/IEC 14882-1998 standard. Please note that this is a very rough list and is not an accurate reflection of what is possible. Some samples give a better impression of what's currently accepted by cppp.

cppp progress overview
A.1 Keywords 0/7 0%
A.2 Lexical conventions 0/43 0%
A.3 Basic concepts 1/1 100%
A.4 Expressions 2/35 5.7%
A.5 Statements 4/11 36.3%
A.6 Declarations 2/33 6.1%
A.7 Declarators 2/20 10%
A.8 Classes 3/9 33.3%
A.9 Derived classes 0/4 0%
A.10 Special member functions 0/7 0%
A.11 Overloading 0/2 0%
A.12 Templates 2/10 20%
A.13 Exception handling 0/8 0%
A.14 Preprocessing directives 0/14 0%

cppp is a work in progress and not yet ready for a first release. If you are interested feel free to mail me : bvh-cplusplus@irule.be.

Back to my c++ software projects