Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Two reasons in the wild:

1. You might not know a priori that the lexical analysis can be done without any knowledge of the surrounding grammatical context.

2. You may be able to give more informative error messages if you know the grammatical context.



Agreed, and I would state it more strongly: it's unclear how / significant extra work to provide good error messages if you have a separate lexer stage. And sooner or later you will want good error messages.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: