News for hackers. Stuff that matters.
Re:Re2c: A free and open-source lexer generator for C and C++ by chubot on Friday March 01, 2019 @12:48PM (#19283411)
FWIW I encountered re2c in the Ninja lexer

https://github.com/ninja-build/ninja/blob/master/src/lexer.i...

and then used it for my own huge shell lexer:

The Oil Lexer: Introduction and Recap http://www.oilshell.org/blog/2017/12/15.html

The nice thing about it is that it doesn't impose any constraints on the structure of your code.

lex/flex probably have options not generate piles of messy C code with global variables at this point, but IMO there's no reason not to use re2c instead, so it's moot.

Re:Re2c: A free and open-source lexer generator for C and C++ by chubot on Friday March 01, 2019 @03:58PM (#19285194)
update: Also re2c gives you "semantic actions" like Ragel or yacc, which is better IMO. Not sure if lex/flex does that. I think it has a hard-coded notion of tokens.
Re:Re2c: A free and open-source lexer generator for C and C++ by saurik on Friday March 01, 2019 @06:56PM (#19286461)
lex/flex definitely supports semantic actions and definitely does not have a hardcoded notion of tokens.