aboutsummaryrefslogtreecommitdiff
path: root/parts/symbol.h
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2025-07-03 19:11:36 +0300
committerkartofen <mladenovnasko0@gmail.com>2025-07-03 19:11:36 +0300
commitf2bef76fb369d4c9c3e53dca60eb78b75bb02d97 (patch)
tree94de181d7dae1d35310e1e9bfbf761b0fc536adf /parts/symbol.h
parent5064a7ebce75a26d0405c92040f1a40187fcc7e3 (diff)
working more or less parser generator (no semantic action, so pretty much useless
Diffstat (limited to 'parts/symbol.h')
-rw-r--r--parts/symbol.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/parts/symbol.h b/parts/symbol.h
index 5f865ec..2e9c30c 100644
--- a/parts/symbol.h
+++ b/parts/symbol.h
@@ -5,8 +5,13 @@ typedef unsigned int symbol;
extern size_t total_symbols;
// extern char *symbol_to_str[] ...
-extern int symbol_is_terminal(symbol s);
-extern int symbol_is_input_end(symbol s);
-extern int symbol_is_valid(symbol s);
+extern int (*symbol_is_terminal)(symbol s);
+extern int (*symbol_is_input_end)(symbol s);
+extern int (*symbol_is_valid)(symbol s);
+
+// helper macro
+#define IMPLEMENT_FUNCPTR(type, name, args, ...) \
+ type __##name args __VA_ARGS__ \
+ type (*name) args = __##name;
#endif