Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

flex & bison use globals to report things per-rule. Of course they are not re-entrant. This is documented by virtue that those are globals.


And the fix is to not use globals. cf. my toplevel post about "%option reentrant", "%lex-param" and "%parse-param".

Globals are just the 80's setup, and flex/bison are supposed to be POSIX lex/yacc compatible, so I'm gonna count this as "shitty defaults due to compatibility with stone tablets".


Correct. It’s the default but it’s no longer necessary.

Flex has had some work done to push it towards being able to generate Go and Rust code too, though this work isn’t finished. In principle it is now possible to generate any Algol–style language.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: