[antlr-interest] ObjC generated code does not match ANTLRWorks

Basil Shkara bshkara at gmail.com
Fri Dec 21 22:39:11 PST 2007


Hi,

I have been finding inconsistent results regarding the behaviour of  
the generated code for the ObjC target and what ANTLRWorks shows me.

I have created a test grammar which does not behave as expected upon  
compiling the resulting ObjC code using the 3.0.1 early access source:

NEWLINE			:	'\r'?'\n';
WS			:	' ' | '\t';
UNDERSCORE		:	'_';
OTHER			:	.;

start			:	(rule|NEWLINE|OTHER|WS)+;
text			:	WS|NEWLINE|OTHER;
rule			:	(UNDERSCORE text+ UNDERSCORE);

My test rig consists of an NSTextView and a delegate class listening  
for the textStorageDidProcessEditing notification.  I have a number of  
class methods which are called from the parser and which perform some  
syntax highlighting.

The anomaly is that whenever a newline is entered, the parser will  
stop parsing from that point on.  After the newline, there is no  
further activity from the parser.

ANTLRWorks (1.1.5) however says that my grammar is fine and it works  
perfectly using the built in interpreter.

Appreciate any help.

Regards,
Basil.


More information about the antlr-interest mailing list