Hacker News
points by arnsholt 3 days ago | 0 comments
Yeah, for “normal” syntax I’d generally go for recursive descent, but for expression parsing with operator precedence I’d implement Pratt parsing if I had any say in the matter.
[–] throw-qqqqq 3 days ago
I think of it as expressions vs statements, but I think we agree.

Lexing for tokenization -> recursive descent for statements -> Pratt parsing for expressions.

S-Expressions and prefix-notation are so easy to work with (compared to in-fix IMO), because the precedence is explicit.

Hacker News