Re:We Need to Know LR and Recursive Descent Parsing Techniques
by bsder on Tuesday January 17, 2023 @03:11PM
(#34418165)
> IMHO the majority of engineers not understanding lexing/parsing beyond generators has held back good engineering of incremental parsers/lexers for a long time.
That's a touch unfair. You could easily extend that statement to "The predominant languages of C and C++ have held back good engineering of parsers/lexers." period. This is due to the fact that you effectively have to parse the universe to resolve the symbol table in both languages.
In addition, people didn't need incremental parsing until syntax highlighting became widespread via LSPs. Before that, you were always working at the compile level, so why put in all the work for an incremental parser you were never going to make use of?
People have recently been designing the languages, themselves to better support parsing/lexing paradigms that can be incremental and restarted.
This is why most modern languages have converged to having specific syntax to delineate the difference between variable name and variable type, for example.
Rust, for example, has fairly funky things around "unary minus" because of its design for parsing and lexing.
That's a touch unfair. You could easily extend that statement to "The predominant languages of C and C++ have held back good engineering of parsers/lexers." period. This is due to the fact that you effectively have to parse the universe to resolve the symbol table in both languages.
In addition, people didn't need incremental parsing until syntax highlighting became widespread via LSPs. Before that, you were always working at the compile level, so why put in all the work for an incremental parser you were never going to make use of?
People have recently been designing the languages, themselves to better support parsing/lexing paradigms that can be incremental and restarted.
This is why most modern languages have converged to having specific syntax to delineate the difference between variable name and variable type, for example.
Rust, for example, has fairly funky things around "unary minus" because of its design for parsing and lexing.