Download
Carburetta is available for download in source form. The current version is v0.8.20, available from:
.tar.gz
format : https://github.com/kingletbv/carburetta/releases/download/v0.8.20/carburetta-v0.8.20.tar.gz.zip
format: https://github.com/kingletbv/carburetta/releases/download/v0.8.20/carburetta-v0.8.20.zip
Build on Linux
First retrieve the source release:
Unzip or untar it, and enter its directory.
To build carburetta, you will need to have clang or gcc installed, then enter make:
Carburetta has now been built, what remains is to install it in /usr/local/bin
:
Build on Windows
Windows is supported, however, there is currently no installer available, consequently, you will have to build it from source. You will need Microsoft Visual Studio 2022 for this, Community Edition is fine.
First download and extract the source. In the source directory you will see a carburetta.sln
file. This is the Microsoft Visual Studio 2022 solution file for the project.
Open the carburetta.sln
solution in visual studio, set the configuration to Release
and x64
and build it.
After building, the carburetta executable is stored at carburetta\build\Win_amd64\Release\carburetta.exe
.
Command line usage
Enter the carburetta
command with no arguments to see its commandline usage:
$ carburetta
Error: need an input filename
Carburetta parser generator (C) 2020-2023 Kinglet B.V.
version 0.8.20
https://carburetta.com/
carburetta <inputfile.cbrt> [ --c [ <c_filename> [--h [h_filename] ] ] ]
<inputfile.cbrt>
the input file containing the grammar (mandatory)
--c
generate a C file (implied if ommitted)
--c [<c_filename>]
generate a C file and output it to c_filename. If no filename is
specified, then output will be to stdout
--h [<h_filename>]
generate a C header file and output it to h_filename. If no filename
is present, a c_filename must be present as it will then be used to
derive a filename for the header file.
Carburetta always takes an explicit input file (you cannot stream the input via stdin), and generates at least a C file of the same name, but with the file extension changed to C. The --c
option indicates that a C file should be generated, and takes an optional filename for that C file. To also generate a header file, specify the --h
option. The --h
option also takes an optional filename for the header file. If the header filename is not specified, then one is generated by changing the file extension of the C filename.
Further reading
If you are new to Carburetta, your best next step is to study the Documentation, it contains further examples.
Github
Development of Carburetta occurs on github at https://github.com/kingletbv/carburetta. Please note that pull requests are not currently accepted, both due to the intricacies of the codebase making review of foreign changes complex, and the impracticality of ensuring and/or transferring code ownership.