Thursday, August 31, 2006

Free Programming Language Grammars for Building Compilers

ANSI C++ Grammar This is not exactly a grammar of ANSI C++, since it actually accepts a superset of C++ constructs. However, if you're thinking of writing your own grammar, this might serve as a starting point for your own. It is taken from the Working Paper (1996) for the Draft Proposed International Standard for Information Systems--Programming Language C++. GNU ANSI C/C++ Grammar There's nothing like the grammar and source code of an existing world famous compiler, the GNU C/C++ Compiler, to use as a template for your own compiler design. This compiler, and consequently its grammar, actually tries to keep up with the ANSI standards (unlike the popular compiler from a certain well-known OS manufacturer, which only pays lip service to the term "standards compliance"). VS COBOL II Grammar According to their website, "this grammar has been recovered from IBM's VS-COBOL II Reference Summary" and is supposed to be "fully-tested". COBOL Language Grammar This grammar, in its current incomplete and uncorrected form, was apparently "recovered from IBM's COBOL Language Reference". OS PL/I V2R3 Grammar Using an automated tool, the grammar given in IBM's OS PL/I V2R3 Language Reference is available from this website. It is apparently still incomplete. Ada 95 Grammar This grammar of the Ada follows the Ada 95 Reference Manual. It is currently incomplete.