skvadrik / re2c

Lexer generator for C, C++, Go and Rust.
https://re2c.org
Other
1.07k stars 169 forks source link

bison parsers: switch to pure bison API #415

Closed trofi closed 2 years ago

trofi commented 2 years ago

Before the change parsers relied on YYSTYPE global variable. Not very handy for libre2c if it's expected to be used in reentrant or multi-threaded contexts.

The change enables %define api.pure full and adjusts lexer calls to explicitly pass through YYSTYPE around.

%define api.pure full is preferred to %pure-parser (deprecated in 2008, around Bison 2.3b). Should be safe to use.