A S-Expression Parser for C++

Ingo Ruhnke 4d8096c223 Remove obsolete .appveyor.yml il y a 6 mois
benchmarks 9cbadbde87 Fix clang-tidy warnings il y a 5 ans
external 3883208051 Update flake.nix to nixos-23.05 il y a 1 an
include 092d579ab6 Add forward declarations header il y a 3 ans
mk a15f2c45c0 Add and use mk/cmake/TinyCMMC.cmake il y a 1 an
pkgconfig 17329bb93b Add pkgconfig file il y a 5 ans
src 6829f58196 Remove USE_LOCALE, no longer necessary with C++20 il y a 1 an
tests 6829f58196 Remove USE_LOCALE, no longer necessary with C++20 il y a 1 an
.clang-tidy 03cffbd19a Use external/cmake-modules/ClangTidy.cmake instead of manually il y a 4 ans
.gitattributes 6810961ea2 Add VERSION file il y a 2 ans
.gitignore ade5eb3193 Reorganize flake.nix to allow cross-compiling il y a 2 ans
.gitmodules 3ba590de5e Update flake.nix to nixos-22.05 il y a 2 ans
CMakeLists.txt a15f2c45c0 Add and use mk/cmake/TinyCMMC.cmake il y a 1 an
LICENSE.txt 9beb751a57 Added copy of GPLv3 il y a 9 ans
README.md 4ebe3e1a2a Added use_arrays flag to Parser to handle all lists as arrays il y a 9 ans
VERSION 6810961ea2 Add VERSION file il y a 2 ans
flake.lock a6e5a8ec61 Update to nixos-24.05 il y a 6 mois
flake.nix a6e5a8ec61 Update to nixos-24.05 il y a 6 mois
logo.png e5c0ae69da Added logo il y a 9 ans
logo.svg e5c0ae69da Added logo il y a 9 ans
sexp-config.cmake.in 9318a730e1 Use @PACKAGE_INIT@ in sexp-config.cmake.in il y a 2 ans
sexpcpp.nix ade5eb3193 Reorganize flake.nix to allow cross-compiling il y a 2 ans

README.md

Build Status

SExp - A S-Expression Parser for C++

SExp is an S-Expression parser for C++.

Example Code:

sexp::Value value = sexp::Parser::from_string("(1 2 3 4 5)")
sexpr::Value const& head = value.get_car();
sexpr::Value const& tail = value.get_cdr();
if (head.is_integer())
{
   std::cout << head.as_int() << std::endl;
}

Arrays vs Cons

When dealing with large amounts of data the classic Scheme list comes with quite abit of a performance penentaly, for this reason SExp allows you to interpret all list as arrays:

sexp::Parser::from_stream(fin, sexp::Parser::USE_ARRAYS);

C++ locales

If C++ locales are used in your code, compile with:

cmake -DSEXP_USE_LOCALE=ON

Otherwise the input and output functions will produce incorrect results (i.e. "1,5" instead of "1.5").