[antlr-interest] Problems

John Batty john at glowingslab.com
Mon May 31 14:21:12 PDT 2010


Hi

I am trying to buld a grammar from the ANTLR grammar list (http://www.antlr.org/grammar/list 
), using ANTLR V3.2.

C Preprocessor
Youngki KU Wed Dec 20, 2006 17:38
C preprocessor grammar and tree.

The build fails with a large number of errors:
[22:05:28] error(100): Cpp.g:135:20: syntax error: antlr: Cpp.g: 
135:20: unexpected token: ^
[22:05:28] error(100): Cpp.g:136:20: syntax error: antlr: Cpp.g: 
136:20: unexpected token: ^
[22:05:28] error(100): Cpp.g:137:21: syntax error: antlr: Cpp.g: 
137:21: unexpected token: ^
[22:05:28] error(100): Cpp.g:138:18: syntax error: antlr: Cpp.g: 
138:18: unexpected token: ^

The corresponding grammar is...

assignmentExpression
		:	conditionalExpression
			(	(	ASSIGNEQUAL^^
				|   TIMESEQUAL^^
				|   DIVIDEEQUAL^^
				|   MODEQUAL^^
				|   PLUSEQUAL^^
				|   MINUSEQUAL^^
				|   SHIFTLEFTEQUAL^^
				|   SHIFTRIGHTEQUAL^^
				|	BITWISEANDEQUAL^^
				|	BITWISEXOREQUAL^^
				|	BITWISEOREQUAL^^
				)
			assignmentExpression
			)?
		;

So it is clearly the "^^" construct that ANTLR does not like.  I  
assume these is an ANTL version issue.

Can anyone tell me what this construct means in older versions of  
ANTLR, and what I need to do to make it work with ANTLR V3.2?

Best regards,

John




More information about the antlr-interest mailing list