What does the -y / -yacc flag do in a bison?

I searched the man page and found this. But what does this mean? without it, my bison file does not compile, and I would like to know why this is not (admittedly, I have several shifts / decreases and decreases / decreases errors. But this should not stop it?).

Does anyone have a link to what she is actually doing or why she will not compile my code?

   -y, --yacc
          emulate POSIX Yacc
+3
source share
1 answer

By default, Bison generates one set of file names, but POSIX requires a different set of file names. The flag -yallows Bison to generate POSIX names instead of its own set of names.

grammar.y Bison grammar.tab.c ( grammar.tab.h, ). -y Bison y.tab.c y.tab.h.

, -y . , , .

, ; :

$ diff y.tab.c grammar.tab.c
558c558
< #line 559 "y.tab.c"
---
> #line 559 "grammar.tab.c"
2828c2828
<     { stmt_type = STMT_NONE; }
---
>     { stmt_type = STMT_NONE; ;}
2833c2833
<     { stmt_type = STMT_LOAD; }
---
>     { stmt_type = STMT_LOAD; ;}
...
+3

Source: https://habr.com/ru/post/1791524/


All Articles