It defines four levels of language complexity from 0 (very difficult to parse) to 3 (very easy to parse.) Most modern programming languages are level 2, context-free languages, because it's difficult to create a useful language without a recursive grammar, which is what differentiates level 2 from level 3. From the vocabulary you're using, you may already know a few things about parsing theory and the Chomsky hierarchy. Unfortunately, C (and by extension any superset of the language, such as Objective-C) is difficult to parse. You're right in that your overall task is a source-to-source compiler, and that you need to start with a parser. We start by breaking it down into smaller and smaller tasks until we get them down to the level of a problem we know how to solve. But then again, so are most things worth doing in programming.
0 Comments
Leave a Reply. |