aboutsummaryrefslogtreecommitdiff
path: root/parts/symbol.h
blob: e5e45d3a6db24759d26e0eec2a533dcd01842fd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef SYMBOL_H
#define SYMBOL_H

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);

// helper macro
#define IMPLEMENT_FUNCPTR(type, name, args)  \
    type __##name args;                      \
    type (*name) args = __##name;            \
    type __##name args

#endif