From f2bef76fb369d4c9c3e53dca60eb78b75bb02d97 Mon Sep 17 00:00:00 2001 From: kartofen Date: Thu, 3 Jul 2025 19:11:36 +0300 Subject: working more or less parser generator (no semantic action, so pretty much useless --- parts/table.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'parts/table.h') diff --git a/parts/table.h b/parts/table.h index 23c61dc..44d1e12 100644 --- a/parts/table.h +++ b/parts/table.h @@ -12,12 +12,13 @@ extern struct action { extern size_t table_states; -extern int table_fill(); -extern void table_free(); +/*extern*/ int table_fill(); +/*extern*/ void table_free(); void table_print(); void table_print_cstyle(); #include "symbol.h" + void table_print() { printf(" "); @@ -40,7 +41,7 @@ void table_print() void table_print_cstyle() { for(size_t i = 0; i < table_states; i++) { - printf("{"); + printf("(struct action[]){"); for(size_t sym = 0; sym < total_symbols; sym++) printf("{%d, %zu},", table[i][sym].type, table[i][sym].arg); printf("},\n"); -- cgit v1.2.3