YAML parsing - lex or hand-rolled?
问题 I am trying to write a simple YAML parser, I read the spec from yaml.org, before I start, I was wondering if it is better to write a hand-rolled parser, or use lex ( flex/bison ). I looked at the libyaml (C library) - doesn't seem to use lex/yacc . YAML (excluding the flow styles ), seems to be more line-oriented, so, is it easier to write a hand-rolled parser, or use flex/bison Thanks. 回答1: This answer is basically an answer to the question: "Should I roll my own parser or use parser