3 ms·
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.
by dmitrygr 5y ago
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.
- 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.