I showed this to my roommate, and he mentioned in his product, the lexer is similarly written. The reason for this is, apparently, it is a really simple way of implementing a finite state machine.<p>Wikipedia mentions the pattern as well:<p>"The lex/flex family of generators uses a table-driven approach which is much less efficient than the directly coded approach. With the latter approach the generator produces an engine that directly jumps to follow-up states via goto statements. Tools like re2c and Quex have proven (e.g. article about re2c) to produce engines that are between two to three times faster than flex produced engines.[citation needed] It is in general difficult to hand-write analyzers that perform better than engines generated by these latter tools." (<a href="http://en.wikipedia.org/wiki/Lexical_analysis" rel="nofollow">http://en.wikipedia.org/wiki/Lexical_analysis</a>)
Yawn. Sometimes, code is both messy and perfectly functional. At that point, the best thing for the business/community is to spend time thinking about something else until you need to make changes to that chunk of code.
The best you can come up with is how tangled the code in a hand-written lexer looks? I may have skimmed a bit towards the end, but, did you actually find a bug?
This guy is not doing a fair review. He is just badmouthing the code without providing alternatives. The code doesn't look good, but a constructive review would be much more appreciated by everyone. By acting this way, he is just making a fool of himself.