xogeny / denada-go

A Golang implementation of Denada
32 stars 4 forks source link

Better Parser #2

Closed xogeny closed 10 years ago

xogeny commented 10 years ago

The grammar for denada is so simple, that I think it would be straightforward to write a recursive descent parser. This has several advantages.

First, it simplifies the tool chain (although that isn't much of an issue). More importantly, it allows a parser to be created that is more reentrant. There are still potential issues with nex that might prevent this. But it is a first step.

Second, I think I can be clever in a hand-built parser to utilize existing JSON parsers to handle JSON related functionality (see #1).

Finally, I think it will deliver much better diagnostics when parsing. Ideally, it should provide specific feedback on expected token vs. actual token.

xogeny commented 10 years ago

I'm marking this resolved as of e9ae73e4dcc8d35e1145029294d87d6f82f1cc98