Monday, March 21, 2011
Useless information: I tried to write a decent .NET parser for YAML over the weekend. I failed, but learned a few things
- I didn't have a good handle on what YAML was. For example, I didn't realize that whitespace was significant.
- YAML is a full superset of JSON.
- YAML defines all kinds of stuff to support strongly typed serialization that I didn't want and didn't need.
- The grammar presented in the YAML standard isn't particularly well suited for copying because it ends up with all sorts of useless rules that the lexer or parser doesn't like and you have to manually eliminate.
- One of the main YAML guys apparently tried to built a parser for YAML on top of ANTLR (which is what I was trying to use) a few years back. It looks like he gave up fairly early on.
- I probably should've started by copying SnakeYaml, which is a pretty good Java implementation.