librdesc
Loading...
Searching...
No Matches
Pipe-Math Grammar Definition
/* <stmt> ::= */ r(
NT(EXPR), TK(SEMI)
),
/* <expr> ::= */ r(
NT(EXPONENTIATION_EXPR), TK(PIPE), NT(PIPE_EXPR)
alt NT(EXPONENTIATION_EXPR)
)
,
/* <exponentiation_expr> ::= */
rrr(EXPONENTIATION_EXPR, (TK(NUM)), (TK(CARET), TK(NUM))),
/* this also expands to <exponentiation_expr_rest> */
/* <pipe_expr> ::= */
rrr(PIPE_EXPR, (NT(FUNCTION_CALL)), (TK(PIPE), NT(FUNCTION_CALL))),
/* similarly, this also expands to <pipe_expr_rest> */
/* <function_arg_ls> ::= */
rrr(FUNCTION_ARG_LS, (NT(EXPR)), (TK(COMMA), NT(EXPR)))
/* <function_arg_ls_rest> */
,
/* <function_call> ::= */ r(
TK(IDENT), TK(LPAREN), NT(FUNCTION_ARG_LS), TK(RPAREN)
alt TK(IDENT)
)
#define rrr(head, base, suffix)
Defines right-recursive list rules. base and suffix parameters should wrapped with parenthesis (()).
#define NT(nt)
Macro to create a nonterminal production symbol.
Definition rule_macros.h:58
#define TK(tk)
Macro to create a terminal (token) production symbol.
Definition rule_macros.h:56
#define r(...)
Macro to define a grammar rule. Adds end of alternative and end of production body sentinels to gramm...
Definition rule_macros.h:72
#define alt
Separates grammar alternatives (alternative separator).