Loading...
Searching...
No Matches
Go to the documentation of this file.
24#ifndef RDESC_RULE_MACROS_H
25#define RDESC_RULE_MACROS_H
30#define PREFIX_TK(tk) TK_ ## tk
35#define PREFIX_NT(nt) NT_ ## nt
38#ifndef POSTFIX_NT_REST
40#define POSTFIX_NT_REST(nt) nt ## _REST
50#define SEOA { .ty = RDESC_SENTINEL, .id = EOA }
52#define SEOP { { .ty = RDESC_SENTINEL, .id = EOP } }
56#define TK(tk) { .ty = RDESC_TOKEN, .id = PREFIX_TK(tk) }
58#define NT(nt) { .ty = RDESC_NONTERMINAL, .id = PREFIX_NT(nt) }
72#define r(...) { { __VA_ARGS__, SEOA }, SEOP }
92 r(__VA_ARGS__ alt EPSILON)
121#define rrr(head, base, suffix) \
122 r(_rdesc_priv_trim_paren base, NT(POSTFIX_NT_REST(head))), \
123 ropt(_rdesc_priv_trim_paren suffix, NT(POSTFIX_NT_REST(head)))
133#define alt , SEOA, }, {
136#define _rdesc_priv_trim_paren(...) __VA_ARGS__