4 ms·
My knowledge in this area is very dated. But is Lex (Flex) & Yacc (Bison) not the standard way to parse? Many years ago when I was trying parsing for something
by perfopt 5y ago
My knowledge in this area is very dated. But is Lex (Flex) & Yacc (Bison) not the standard way to parse?
Many years ago when I was trying parsing for something else I was informed that these tools generally do as good if not a better job than hand written parsers.
Does that not hold any more?
Though, Flex+Bison is not the easiest of tools to learn.
- massinstall 5y agoGoing by OP's description, Flex and Bison appear to be well suited for what he/she intends to do. There is a bit of a learning curve, but I think it's well worth it. I have been working with both for a few years now and find them very flexible. FYI, Bison supports parsers using either LALR(1) (Look-Ahead Left-to-Right with 1 token lookahead) [https://en.wikipedia.org/wiki/LALR_parser https://en.wikipedia.org/wiki/LALR_parser] or GLR (generalized Left-To-Right) [https://en.wikipedia.org/wiki/GLR_parser https://en.wikipedia.org/wiki/GLR_parser]. O'Reilly's book "flex & bison" by John Levine is a helpful reference. [https://www.amazon.com/flex-bison-Text-Processing-Tools/dp/0596155972 https://www.amazon.com/flex-bison-Text-Processing-Tools/dp/0...]