diff options
author | kartofen <mladenovnasko0@gmail.com> | 2025-07-03 19:11:36 +0300 |
---|---|---|
committer | kartofen <mladenovnasko0@gmail.com> | 2025-07-03 19:11:36 +0300 |
commit | f2bef76fb369d4c9c3e53dca60eb78b75bb02d97 (patch) | |
tree | 94de181d7dae1d35310e1e9bfbf761b0fc536adf /parts/symbol.h | |
parent | 5064a7ebce75a26d0405c92040f1a40187fcc7e3 (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.h | 11 |
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 |