Adiciona tinyblocks-blueprint e libraries json/xml/csv; abrir/salvar/exportar projeto
- tinyblocks-blueprint: dona do estado de edicao (abas, pool de blocos, vinculos parent/prel/next/sub/args, blocos compostos e variaveis) e da serializacao. JSON nativo (to/from) usando a AST JSON do core e export JSON/XML/CSV. Testado com round-trip (test-blueprint). - tinyblocks-json: lexer + parser + emissor JSON independentes. - tinyblocks-xml: lexer + parser de XML -> AST JSON do core + emissor. - tinyblocks-csv: divisor de linhas/campos + parser/emissor sobre a AST JSON. - Editor: botoes Abrir / Salvar / Exportar JSON XML CSV no menu; converte Ed <-> TbBlueprint; barra de caminho com modo; .json pode ser arrastado. - Variaveis: tb_variables_clear e tb_variables_set_text. - Harness: teste de salvar/abrir projeto; tests/blueprint_test.c.
This commit is contained in:
1 parent
dc23b92d15
commit
1199d2d7c7
39 files changed
+3462
-24
No files matched your search
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* TinyBlocks - tinyblocks-json / include/lexeme.h
|
||||
* Lexer de JSON: transforma o texto em uma lista de lexemas.
|
||||
*/
|
||||
#ifndef TB_JSON_LEXEME_H
|
||||
#define TB_JSON_LEXEME_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef enum {
|
||||
JL_EOF, JL_ERROR,
|
||||
JL_LBRACE, JL_RBRACE, JL_LBRACKET, JL_RBRACKET,
|
||||
JL_COLON, JL_COMMA,
|
||||
JL_STRING, JL_NUMBER, JL_TRUE, JL_FALSE, JL_NULL
|
||||
} JsonLexKind;
|
||||
|
||||
typedef struct {
|
||||
JsonLexKind kind;
|
||||
const char* start; /* inicio no texto original */
|
||||
size_t len;
|
||||
int line, col;
|
||||
char* text; /* string decodificada (JL_STRING) */
|
||||
bool is_int;
|
||||
long long ival;
|
||||
double num;
|
||||
} JsonLexeme;
|
||||
|
||||
typedef struct { JsonLexeme* items; size_t count, cap; } JsonLexemeList;
|
||||
|
||||
typedef struct { bool ok; char msg[128]; int line, col; } JsonLexError;
|
||||
|
||||
/* Tokeniza 'src'; em sucesso devolve true e preenche 'out'. */
|
||||
bool json_lex(const char* src, JsonLexemeList* out, JsonLexError* err);
|
||||
void json_lexemes_free(JsonLexemeList* l);
|
||||
const char* json_lexeme_name(JsonLexKind k);
|
||||
|
||||
#endif /* TB_JSON_LEXEME_H */
|
||||
Reference in new issue
Block a user