Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 818 Bytes

README.md

File metadata and controls

40 lines (32 loc) · 818 Bytes

adn

The best data serialization format is a modified version of edn.

We have a very brief spec and an almost complete implementation.

Usage

To use the adn Reference Implementation, you just have to put it in your include path and include it, then you can make use of the Lexer and Parser:

#include <adn.hh>
#include <cassert>
#include <iostream>

int main() {
    auto tokens = Adn::Lexer::Lex(U"(1 2 3)");
    auto elements = Adn::Parser::Parse(tokens);
    for(auto list : elements) {
        assert(list.type == Adn::Parser::List);
        for(auto element : list.vec) {
            assert(element.type == Adn::Parser::Int);
            std::cout << element.i << std::endl;
        }
    }
    return 0;
}
c++ -I/path/to/adn example.cc -o example
./example
1
2
3