A S-Expression Parser for C++

Ingo Ruhnke 6018831abc Add missing <sstream> include %!s(int64=4) %!d(string=hai) anos
benchmarks 9cbadbde87 Fix clang-tidy warnings %!s(int64=5) %!d(string=hai) anos
external 8916bef706 Update external/ libaries %!s(int64=5) %!d(string=hai) anos
include 9cbadbde87 Fix clang-tidy warnings %!s(int64=5) %!d(string=hai) anos
src 6018831abc Add missing <sstream> include %!s(int64=4) %!d(string=hai) anos
tests 98f3df319d Fix size test case under MSVC x64 %!s(int64=5) %!d(string=hai) anos
.appveyor.yml 1830cba224 Do Appveyor build with x86/x64 and Debug/Release %!s(int64=5) %!d(string=hai) anos
.clang-tidy 47c6398251 Add clang-tidy configuration %!s(int64=5) %!d(string=hai) anos
.gitignore 44b4037dac More .gitignore %!s(int64=5) %!d(string=hai) anos
.gitlab-ci.yml caca0ea9f8 Enabled benchmark building in .gitlab-ci.yml %!s(int64=6) %!d(string=hai) anos
.gitmodules 44ffa83e81 Added googletest and google-benchmark submodules %!s(int64=8) %!d(string=hai) anos
.travis.yml f30a01d2d2 Install language-pack to avoid: %!s(int64=8) %!d(string=hai) anos
CMakeLists.txt 8abec55cfb Add clang-tidy support to CMakeLists.txt %!s(int64=5) %!d(string=hai) anos
LICENSE.txt 9beb751a57 Added copy of GPLv3 %!s(int64=8) %!d(string=hai) anos
README.md 4ebe3e1a2a Added use_arrays flag to Parser to handle all lists as arrays %!s(int64=8) %!d(string=hai) anos
logo.png e5c0ae69da Added logo %!s(int64=8) %!d(string=hai) anos
logo.svg e5c0ae69da Added logo %!s(int64=8) %!d(string=hai) anos

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").