[antlr-interest] Fwd: ObjectiveC grammar

Eric researcher0x00 at gmail.com
Sat Feb 11 04:56:55 PST 2012


---------- Forwarded message ----------
From: Eric <researcher0x00 at gmail.com>
Date: Sat, Feb 11, 2012 at 7:49 AM
Subject: Re: [antlr-interest] ObjectiveC grammar
To: forumer at smartmobili.com


Hi,

Based on the comment in ObjectiveC.g from the github location you noted

/**
* ObjectiveC version 2
* based on an LL ansic grammars and
* and ObjectiveC grammar found in Learning Object C
*
* It's a Work in progress, most of the .h file can be parsed
* June 2008 Cedric Cuche
**/

I would consider it incomplete and contact Cedric Cuche for details.

There seems to be another ObjectiveC grammar by Alan Condit. It is in the
ANTLR 3.4 download as ObjC

See: http://www.antlr.org/wiki/display/ANTLR3/ANTLR3+Objective-C+Target

Hope that helps,

Eric

On Sat, Feb 11, 2012 at 4:48 AM, <forumer at smartmobili.com> wrote:

> Hi,
>
> I am new to antlr and for the moment I have started to watch the great
> video tutorials by Scott Stanchfield.
> TO start working with antlr I would like to parse objective-c and I
> have downloaded grammar from Cedric Cuche,
> however when I try to parse very simple example I got some errors :
>
> //
> //  SimpleCar.h
> //  CarClassTest
> //
> //
>
> #import <Cocoa/Cocoa.h>
>
>
> @interface SimpleCar : NSObject {
>
>        NSString* make;
>        NSString* model;
>        NSNumber* vin;
>
> }
>
> // set methods
> - (void) setVin:   (NSNumber*)newVin;
> - (void) setMake:  (NSString*)newMake;
> - (void) setModel: (NSString*)newModel;
>
> // convenience method
> - (void) setMake: (NSString*)newMake andModel: (NSString*)newModel;
>
> // get methods
> - (NSString*) make;
> - (NSString*) model;
> - (NSNumber*) vin;
>
> @end
>
>
> Inside eclipse with the antlr plugin installed, interpreter tells me :
>
> Failed predicate exception : line 2:0 rule translation_unit failed:
> {can't deal with predicated yet}?
>
> The project is located here :
> https://github.com/smartmobili/parsing/tree/master/ObjectiveC/antlr-objc
>
> What am I doing wrong ?
>
> Thanks
>
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>


More information about the antlr-interest mailing list