[antlr-interest] Anybody got an ObjectiveC grammar?

David Ewing dewing at apple.com
Thu May 2 08:54:17 PDT 2002

on 5/2/02 12:53 AM, Silvain Piree at s.piree at enneya.com wrote:

>> Heh I found it!
>> http://www.antlr.org/1.33/contrib/ObjC.g
>> At the website all the time folks :)  I new I got it from NeXT at one
>> point...they forced me to strip actions, but here is the grammar :)
> That's great, but .... do you know if it's complete?
> I checked it only to find that it did not contain any statement
> definitions. E.g. the rule "compound_statement" is used but
> nowhere defined (or am I missing some other file?).

I don't believe it's intended to be complete. I believe it's meant to work
as part of the C++ grammar for PCCTS.

I think it would be wise to grab the ObjC grammar out of gcc 3 sources and
merge the productions into the antlr C grammar. It might be good enough to
merge the antlr ObjC grammar, but it's possible that there have been ObjC
language changes since that was written. I really don't know what might have
changes, but that PCCTS grammar is pretty old.


P.S. The gcc ObjC grammar can be found in Apple's Darwin open source
repository in gcc3/gcc/c-parse.in. That file is passed through sed to
produce the yacc input files, and the ObjC portions are conveniently wrapped
in "ifobjc"/"end ifobjc" lines.


Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

More information about the antlr-interest mailing list