Ingo Ruhnke 4d8096c223 Remove obsolete .appveyor.yml | 5 months ago | |
---|---|---|
benchmarks | 5 years ago | |
external | 1 year ago | |
include | 3 years ago | |
mk | 1 year ago | |
pkgconfig | 5 years ago | |
src | 1 year ago | |
tests | 1 year ago | |
.clang-tidy | 4 years ago | |
.gitattributes | 2 years ago | |
.gitignore | 2 years ago | |
.gitmodules | 2 years ago | |
CMakeLists.txt | 1 year ago | |
LICENSE.txt | 9 years ago | |
README.md | 9 years ago | |
VERSION | 2 years ago | |
flake.lock | 5 months ago | |
flake.nix | 5 months ago | |
logo.png | 9 years ago | |
logo.svg | 9 years ago | |
sexp-config.cmake.in | 2 years ago | |
sexpcpp.nix | 2 years ago |
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;
}
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);
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").