Skip to content

super-ast/cpptranslate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cpptranslate

C++ code to super-ast translator. Some examples of the translation are provided in the folder examples.

Download clang

mkdir ~/clang-llvm && cd ~/clang-llvm
git clone http://llvm.org/git/llvm.git
cd llvm/tools
git clone http://llvm.org/git/clang.git
cd clang/tools
git clone http://llvm.org/git/clang-tools-extra.git extra

Download cpptranslate

cd ~/clang-llvm/llvm/tools/clang/tools/extra
git clone https://github.com/super-ast/cpptranslate
echo 'add_subdirectory(cpptranslate)' >> CMakeLists.txt

Build cpptranslate

cd ~/clang-llvm
mkdir build
cd build
cmake -G Ninja ../llvm -DLLVM_BUILD_TESTS=OFF
ninja

The resulting binary will be found in ~/clang-llvm/build/bin/cpptranslate.

Usage

To execute cpptranslate:

cpptranslate input_file.cpp --

By default prints the result to standard output. To write into a file:

cpptranslate input_file.cpp -- >output_file.json

You can pass compilation flags as arguments:

cpptranslate input_file.cpp -- -DN=4 >output.json

About

C++ to SuperAST translator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published