4 ms·
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
by truenindb 5y 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.
- dmitrygr 5y agoflex & bison use globals to report things per-rule. Of course they are not re-entrant. This is documented by virtue that those are globals.
- eqvinox 5y agoAnd 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".
- db48x 5y agoCorrect. 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.