Hacker News new | ask | show | jobs
by rocket69 3555 days ago
So, what parses the regex in the lex, flex, Jison, etc...
1 comments

Most tools like that reduces any regexes to dfa's or similar, but most production compilers I've seen don't use tools like that because they're a pain to do proper error reporting for.
Yea, we're not talking about compilers, we're talking about lexers. Regex doesn't even make a little bit of sense in a compiler world. What lexer are you working with?
One of the main uses of lexers are in compiler.

There are others, certainly, like parsing various configuration formats etc. but they tend to either use tool generated lexers that tend to use dfa's, or handwritten lexers that may or may not use regexes, but there too it's fairly uncommon to see much regex use.

I custom write all of my lexers for exactly the reasons I outlined above.