/* * TinyBlocks - tinyblocks-xml / include/ast.h * * A AST do XML e a arvore JSON do core (TinyBlocks_JsonValue), usando uma * convencao explicita e sem perdas: * * elemento -> { "tag": "nome", * "attrs": { "k": "v", ... }, * "children": [ "texto", {elemento}, ... ] } * * Assim o XML pode ser convertido de/para JSON e reemitido. */ #ifndef TB_XML_AST_H #define TB_XML_AST_H #include #include #include #include "lexeme.h" TinyBlocks_JsonValue* xml_parse(const char* text, char* err, size_t errcap); TinyBlocks_JsonValue* xml_parse_file(const char* path, char* err, size_t errcap); char* xml_to_string(const TinyBlocks_JsonValue* root, bool pretty); bool xml_write_file(const TinyBlocks_JsonValue* root, const char* path, bool pretty); #endif /* TB_XML_AST_H */