[antlr-interest] the ^ character in an ANTLR grammar

David Richards masterxor at rcn.com
Sun Dec 10 12:30:24 PST 2006


I found my own answer so please disregard this post 
Sorry for the band-width...
Dave

-----Original Message-----
From: David Richards [mailto:masterxor at rcn.com] 
Sent: Sunday, December 10, 2006 3:06 PM
To: antlr-interest at antlr.org
Subject: the ^ character in an ANTLR grammar

Hello -
I'm an ANTLR newbie and was wondering about the calc.g grammar file in
examples/java/calc that came with version 2.7.7. The online tutorial (An
Introduction to ANTLR by Terence Paar) states the following grammar rule for
an expression:

expr:   mexpr ((PLUS|MINUS) mexpr)*
    ;      


But the rule that I see in examples/java/calc/calc.g states it as follows:

expr
	:	mexpr (PLUS^ mexpr)* SEMI!

What exactly does the '^' character mean in an ANTLR grammar? I searched
high and low with out success...
Many Thanks!
Dave



More information about the antlr-interest mailing list