Re:We Need to Know LR and Recursive Descent Parsing Techniques
by not2b on Tuesday January 17, 2023 @09:57PM
(#34422913)
gcc's C and C++ parsers are handwritten recursive descent parsers. Years ago, Bison was used, and for C++ a third pass was required between the lexer and the parser to add the needed lookahead to differentiate complex type and function declarations. I didn't say anything about LL(1). The key thing here is that high quality compilers are doing it this way, eschewing parser generation tools.
[ Parent
| on HN ]
Re:We Need to Know LR and Recursive Descent Parsing Techniques
by bitL on Wednesday January 18, 2023 @09:53AM
(#34427294)
I thought that GCC being a handwritten recursive descent parser was giving it a huge disadvantage compared to other compilers when it came to introducing new standards (I remember people complaining about it a lot in the past).
Re:We Need to Know LR and Recursive Descent Parsing Techniques
by not2b on Wednesday January 18, 2023 @10:58AM
(#34428334)
You're misinformed. clang also has a custom parser. Both gcc and clang have great support for new standards, though as those standards are evolving some features aren't there yet (but none of the missing features have anything to do with parsing difficulties). You can find lots of detail on feature coverage at https://gcc.gnu.org .