#include #include #include "../util.h" #include "../list.h" #include "../grammar.h" #include "../reader.h" /* TODO: check string */ int main(U_ATTR int argc, U_ATTR char **argv) { /* return 77; */ char *file_name = "test.txt"; char *buffer = MYALLOC(char, 512); NUM buffer_size = 0; if (read_entire_file(file_name, &buffer, &buffer_size)) { fleprintf("%s:%d, Cannot read file %s", file_name); free(buffer); return 1; } utf8 *s = new_utf8(buffer, buffer_size); Grammar *g = read_grammar_from_bnf((str *) s); print_grammar(g); destroy_grammar(g, 2); destroy_str((str *)s, 1); return 0; }