Is there a standard C++ grammar?

Yes, it does.

The grammar is described in detail throughout the standard and is summarized in Appendix A: Grammar Summary (it’s Appendix A in both the C++03 standard and the C++0x final committee draft).

You can purchase the C++03 standard or you can download the C++0x FCD (it’s document n3092 on that page).

To answer the “what category is it in?” question, the C++ grammar is not context-free (also see the questions linked in answers to that question; they have additional examples of issues related to the C++ grammar and parsing C++).

Leave a Comment