All Projects → msoodb → tanto

msoodb / tanto

Licence: GPL-3.0 License
C json parser and creator library.

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to tanto

Chevrotain
Parser Building Toolkit for JavaScript
Stars: ✭ 1,795 (+8447.62%)
Mutual labels:  parser-library
autumn
A Java parser combinator library written with an unmatched feature set.
Stars: ✭ 112 (+433.33%)
Mutual labels:  parser-library
antk
Redkato, - Indonesian anime scraper
Stars: ✭ 14 (-33.33%)
Mutual labels:  parser-library
Uriparser
🔪 Strictly RFC 3986 compliant URI parsing and handling library written in C89; moved from SourceForge to GitHub
Stars: ✭ 163 (+676.19%)
Mutual labels:  parser-library
Lark
Lark is a parsing toolkit for Python, built with a focus on ergonomics, performance and modularity.
Stars: ✭ 2,916 (+13785.71%)
Mutual labels:  parser-library
kiuatan
A parser library for Pony.
Stars: ✭ 15 (-28.57%)
Mutual labels:  parser-library
Cppcmb
A generic C++17 parser-combinator library with a natural grammar notation.
Stars: ✭ 108 (+414.29%)
Mutual labels:  parser-library
ex spirit
No description or website provided.
Stars: ✭ 26 (+23.81%)
Mutual labels:  parser-library
Scpi Parser
Open Source SCPI device library
Stars: ✭ 227 (+980.95%)
Mutual labels:  parser-library
gab-cmdline
A GABStudios Java library to help with command line parsing.
Stars: ✭ 12 (-42.86%)
Mutual labels:  parser-library
Libpypa
libpypa is a Python parser implemented in pure C++
Stars: ✭ 172 (+719.05%)
Mutual labels:  parser-library
Tatsu
竜 TatSu generates Python parsers from grammars in a variation of EBNF
Stars: ✭ 198 (+842.86%)
Mutual labels:  parser-library
DHTMLParser
D HTML Parser, similar to python BeautifulSoup
Stars: ✭ 17 (-19.05%)
Mutual labels:  parser-library
Pygdbmi
A library to parse gdb mi output and interact with gdb subprocesses
Stars: ✭ 139 (+561.9%)
Mutual labels:  parser-library
gronx
Lightweight, fast and dependency-free Cron expression parser (due checker), task scheduler and/or daemon for Golang (tested on v1.13 and above) and standalone usage
Stars: ✭ 206 (+880.95%)
Mutual labels:  parser-library
Java Petitparser
Dynamic parser combinators in Java.
Stars: ✭ 118 (+461.9%)
Mutual labels:  parser-library
android-pls-parser
A playlist file (*.pls) parser library for Android
Stars: ✭ 19 (-9.52%)
Mutual labels:  parser-library
leftry
Leftry - A left-recursion enabled recursive-descent parser combinator library for Lua.
Stars: ✭ 32 (+52.38%)
Mutual labels:  parser-library
parse it
A python library for parsing multiple types of config files, envvars & command line arguments that takes the headache out of setting app configurations.
Stars: ✭ 86 (+309.52%)
Mutual labels:  parser-library
metal
A Java library for parsing binary data formats, using declarative descriptions.
Stars: ✭ 13 (-38.1%)
Mutual labels:  parser-library

json parser and creator library in C, under development, not ready to use!

tanto.h

Using tanto

To use tanto you can include tanto.h header file.

#include "tanto.h"

typedef in tanto.h

TJSON_t *json;

example usage

TJSON_t *json = NULL;
TANTO_INIT(&json);


TJSON_t *server = tanto_create_node(TANTO_JSON_OBJECT, "server", NULL);
tanto_push(&json, server);

TJSON_t *path = tanto_create_node(TANTO_JSON_OBJECT_FIELD, "path", "http://www.gnu.org/licenses/");
tanto_push(&json, path);


TJSON_t *parser = tanto_create_node(TANTO_JSON_OBJECT_FIELD, "parser", "tanto");
TJSON_t *library = tanto_create_node(TANTO_JSON_OBJECT, "library", NULL);
TJSON_t *lex = tanto_create_node(TANTO_JSON_OBJECT_FIELD, "lex", "lexer");	
tanto_push(&json, parser);
tanto_push(&server, library);
tanto_push(&server, lex);

TJSON_t *usage = tanto_create_node(TANTO_JSON_OBJECT_FIELD ,"usage", "example.c");
TJSON_t *tests = tanto_create_node(TANTO_JSON_OBJECT_FIELD ,"tests", "test.c");	
tanto_push(&library, usage);	
tanto_push(&library, tests);


TJSON_t *color = tanto_create_node(TANTO_JSON_OBJECT_FIELD, "color", "red");
tanto_push(&json, color);

TJSON_t *main = tanto_create_node(TANTO_JSON_OBJECT_FIELD ,"main", "main.c");	
tanto_push(&json, main);


TJSON_t *functions = tanto_create_node(TANTO_JSON_ARRAY, "functions", NULL);
tanto_push(&json, functions);
TJSON_t *pop = tanto_create_node(TANTO_JSON_OBJECT_FIELD ,"pop", NULL);	
tanto_push(&functions, pop);
TJSON_t *push = tanto_create_node(TANTO_JSON_OBJECT_FIELD ,"push", NULL);	
tanto_push(&functions, push);

tanto_write_file("../json/example2-output.json", json);

make examples

$ make example
$ ./example1
$ ./example2
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].