A library to parse C/C++ source as AST
An easy, fast, and robust library to parse C/C++ source code.
CppParser can be used to build tools that need parsing of C/C++ files. It is also used to develop cib, which implements ABI-stable SDK architecture for C++ libraries.
To begin with we will see an example of parsing a hello-world program and see the AST that CppParser creates:
…This example is real and is part of the actual unit tests for CppParser.
For AST traversal, see CppWriter, which uses the generated AST to create files.
git clone https://github.com/satya-das/CppParser.gitcd cppparser
mkdir builds
cd builds
cmake ..
makeAlternatively, if you prefer Ninja instead of make:
cd cppparser
mkdir builds
cd builds
cmake -G Ninja ..
ninjaMake sure you also clone the dependencies. Run the following command in the parent directory of the root of cppparser.
git clone https://github.com/satya-das/common.gitAfter this command the common and cppparser folders should be side by side.
cd cppparser
mkdir builds
cd builds
cmake -G Ninja .. -DCPPPARSER_BUILD_TESTS=ON
ninja && ninja testModify the command by removing -G Ninja if you prefer make.
No open issues yet, or sync has not completed.