Mercurial > lbo > hg > ylisp
view gen/debug_parser.c @ 186:60e493dce3a8 default tip
Fix symbol conflict in debug parser
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Sat, 02 Jul 2022 08:53:40 -0700 |
parents | 1b2bd8c6cc25 |
children |
line wrap: on
line source
#include <stdio.h> #include <src/expr.h> #include <gen/y.tab.h> extern bool YENABLE_DEBUG_PRINT; int y_bison_parse(FILE* in, yvec_t* out, ystr_t* ystr_error); int main(void) { YENABLE_DEBUG_PRINT = true; yvec_t expr; ystr_t err; if (0 < y_bison_parse(stdin, &expr, &err)) { fprintf(stderr, ">>> error: %s\n", ystr_str(&err)); return 1; } fprintf(stderr, ">>> full parse result: \n"); for (size_t i = 0; i < expr.len; i++) { yexpr_debug(YVEC_AT(&expr, i, yexpr_t)); } return 0; }