diff options
| author | kartofen <kartofen.mail.0@protonmail.com> | 2025-07-03 19:11:36 +0300 |
|---|---|---|
| committer | kartofen <kartofen.mail.0@protonmail.com> | 2025-07-03 19:11:36 +0300 |
| commit | 98254bbeb96e1c868d761e81f39f59744a6837c6 (patch) | |
| tree | 94de181d7dae1d35310e1e9bfbf761b0fc536adf /parts/symbol.h | |
| parent | 67447ebd3a51a9af29d18a53a38aba038a0c039e (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 |
