Hacker News new | ask | show | jobs
by truenindb 1824 days ago
The re-entrancy complaint seems legit if actually well founded, although I'd think that it probably says somewhere in Flex/bison docs that the generated parsers expect only to be entered from a single C process. It sounds to me like they were using Flex/Bison generated parsers inside of some huge messy corporate web codebase, probably for webscraping or some kind of semi-structured data cleaning, and the code clammed up in some way.
1 comments

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.