I'm in the middle of writing a CSS parser in C#. I'm well under way, but I also have those times where I wonder if I'm taking the best approach. The things I've considered are:
- Feed the CSS grammar from the W3C into a parser generator and working off that.
- Hand-code a CSS parser off the grammar.
- Use a generated tokenizer, but hand-code the parsing of the productions.
- The reverse of (3) - generate the productions, but hand-code the tokenizer.
Without revealing my current approach, I was wondering how others feel about this, and appreciate any comments and guidance from your experience. Part of this is also to see what questions people ask and compare the questions to what I asked myself.
