22#include "../../include/cfg.h"
25#define PREFIX_TK(tk) TK_ ## tk
27#define PREFIX_NT(nt) NT_ ## nt
29#include "../../include/bnf_dsl.h"
33#define BALG_TK_COUNT 14
39#define BALG_NT_COUNT 17
46#define BALG_NT_VARIANT_COUNT 6
53#define BALG_NT_BODY_LENGTH 5
59 TK_TRUE, TK_FALSE, TK_IDENT,
61 TK_PIPE, TK_AMP, TK_EXCL,
63 TK_LPAREN, TK_RPAREN, TK_LCURLY, TK_RCURLY,
64 TK_EQ, TK_COMMA, TK_SEMI,
69 NT_BIT, NT_IDENT, NT_CALL,
73 NT_EXPR, NT_EXPR_REST,
74 NT_TERM, NT_TERM_REST,
78 NT_STMT, NT_STMTS, NT_ASGN,
81 NT_IDENT_LS, NT_IDENT_LS_REST,
82 NT_EXPR_LS, NT_EXPR_LS_REST,
113 "(",
")",
"\\{",
"\\}",
119 "bit",
"ident",
"call",
126 "stmt",
"stmts",
"asgn",
128 "ident_ls",
"ident_ls_rest",
129 "expr_ls",
"expr_ls_rest",
143 TK(IDENT),
TK(LPAREN),
NT(CALL_OPTPARAMS),
TK(RPAREN),
152 rrr(TERM,
NT(FACTOR),
TK(AMP)),
167 TK(LPAREN),
NT(EXPR),
TK(RPAREN),
184 NT(IDENT_LS),
TK(EQ),
NT(EXPR_LS),
188 rrr(IDENT_LS,
NT(IDENT),
TK(COMMA)),
191 rrr(EXPR_LS,
NT(EXPR),
TK(COMMA)),
#define NT(nt)
Macro to create a non-terminal production symbol.
Definition: bnf_dsl.h:63
#define ropt(...)
Macro to define an optional grammar rule (epsilon production).
Definition: bnf_dsl.h:99
#define TK(tk)
Macro to create a terminal (token) production symbol.
Definition: bnf_dsl.h:61
#define r(...)
Macro to define a grammar rule. Adds end-of-body and construct sentinels to grammar rules.
Definition: bnf_dsl.h:72
#define rrr(head, listelem, delim)
Macro to define a pair of rules for a right-recursive list.
Definition: bnf_dsl.h:88
#define alt
Macro for syntactic sugar to separate non-terminal alternatives.
Definition: bnf_dsl.h:106
#define BALG_NT_BODY_LENGTH
Maximum number of symbols in a production body (Right-Hand Side) and +1 for end-of-body sentinel....
Definition: boolean_algebra.h:53
const char balg_tks[BALG_TK_COUNT]
token character mapping (for exblex)
Definition: boolean_algebra.h:86
#define BALG_NT_VARIANT_COUNT
Maximum number of production variants (alternatives) for a single non-terminal and +1 for end-of-cons...
Definition: boolean_algebra.h:46
#define BALG_TK_COUNT
total count of terminal symbols
Definition: boolean_algebra.h:33
balg_nt
non-terminal Symbols
Definition: boolean_algebra.h:68
const char *const balg_tk_names_escaped[BALG_TK_COUNT]
names of tokens that can be used in dotlang graph (special chars are escaped)
Definition: boolean_algebra.h:109
balg_tk
terminal symbols (tokens)
Definition: boolean_algebra.h:56
const char *const balg_tk_names[BALG_TK_COUNT]
names of tokens that used in BNF
Definition: boolean_algebra.h:97
#define BALG_NT_COUNT
Total count of non-terminal symbols defined in enum balg_nt. Determines the size of the first dimensi...
Definition: boolean_algebra.h:39
const char *const balg_nt_names[BALG_NT_COUNT]
non-terminal names (for debugging/printing CST)
Definition: boolean_algebra.h:118
A terminal/non-terminal to describe body (right side) of a production rule.
Definition: cfg.h:45