Monday, March 21, 2011


Weekend Hacking Failure: .NET parser for YAML in ANTLR

Useless information: I tried to write a decent .NET parser for YAML over the weekend. I failed, but learned a few things
  1. I didn't have a good handle on what YAML was. For example, I didn't realize that whitespace was significant.
  2. YAML is a full superset of JSON.
  3. YAML defines all kinds of stuff to support strongly typed serialization that I didn't want and didn't need.
  4. 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.
  5. 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.
  6. I probably should've started by copying SnakeYaml, which is a pretty good Java implementation.

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?