[antlr-interest] C++ grammar, troubleshooting mutually left recursive rules

Ludwig Maes ludwig.maes at gmail.com
Wed Apr 4 18:06:27 PDT 2012


The grammar in attachment contains the following 3 rules which are
supposedly mutually left recursive:


decl_specifier_seq	: decl_specifier attribute_specifier_seq? // C++0x:
			| decl_specifier decl_specifier_seq // C++0x:
			;


type_specifier_seq	: type_specifier attribute_specifier_seq? // C++0x:
			| type_specifier type_specifier_seq
			;


trailing_type_specifier_seq	: trailing_type_specifier
attribute_specifier_seq? // C++0x:
				| trailing_type_specifier trailing_type_specifier_seq // C++0x:
				;

However I fail to find the mutual left-recursion ( have been
navigating through usages and trying to find how one of these three
can call one of the other two but failed to find such a path). I
believe it is something about the way they are defined, since all 3
share the same structure... what am I doing wrong?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cpp.g
Type: application/octet-stream
Size: 33758 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20120405/e8d4b230/attachment.obj 


More information about the antlr-interest mailing list