I wanted to experiment so I removed glr-parser and to my surprise maybeTest
blew up on me. I was expecting empty rules return  0 like it does for
glr-parser. Is there a reason why it doesn't? (It doesn't make sense as an
optimization)

program: maybeTest { printf("%d", $1); }
Test: '?' { $$=1; }
maybeTest: | Test

I can fix it like the below but I have a lot of rules that are optional.
I'm using bison 2.4.1 for windows. I may start doing builds on linux with
the latest (2.7?)
program: maybeTest { printf("%d", $1); }
Test: '?' { $$=1; }
maybeTest: {$$=0;}| Test
_______________________________________________
help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to