C or Java grammar in BNF?

Started by
1 comment, last by Gefilus 24 years, 1 month ago
I''m working on a scripting system. I intend to make it somewhat object oriented with a C/java-like syntax, and need to start with a Yacc-compatible parse rule set. Does anyone know any links to examples of java or C syntax in Backus-Naur Form? I''m sure it would be more effective to start cutting down from an tried and tested implementation, than to start figuring out all the schemantics from scratch myself... To specify, I don''t necessarily need the complete Yacc file, just the BNF form.
Advertisement
I believe Johnston''s RDP program comes with a C BNF file. Usually your compiler documentation will contain an grammar for the language as well. For example C++ Builder comes with a help faile call "C++ Builder Language Guide" that lays out, section by section, the C++ grammar.
Try with javacc. It comes with a full description of the Java grammar. Not in BNF, however, I''m afraid.

This topic is closed to new replies.

Advertisement