What makes Java easier to parse than C?
问题 I'm acquainted with the fact that the grammars of C and C++ are context-sensitive, and in particular you need a "lexer hack" in C. On the other hand, I'm under the impression that you can parse Java with only 2 tokens of look-ahead, despite considerable similarity between the two languages. What would you have to change about C to make it more tractable to parse? I ask because all of the examples I've seen of C's context-sensitivity are technically allowable but awfully weird. For example,