Comment

Comment by gavinhoward

I usually love Laurence's posts. However, one thing he said in this one is wrong in my experience.

> Since some parsing approaches such as recursive descent parsing unify these phases, why do lex and yacc split them apart?

I have written two recursive descent parsers for one small, but production quality compiler. I am in the middle of writing another two, which will also be production quality and much bigger. And I have written various small parsers.

I always use recursive descent, and I always split the lexing and parsing phases.

Now, I fully acknowledge that my experience could be an outlier, but I believe the benefits of lexing are so big that most recursive descent parsers have separate lexers.

parent gavinhoward 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton