diff options
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 |