aboutsummaryrefslogtreecommitdiff
path: root/parts/symbol.h
blob: dea457ef4553b58909e232c2a20a7528d7e04a33 (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