[antlr-interest] basic question

Terence Parr parrt at jguru.com
Wed Jan 23 09:59:36 PST 2002


On Wednesday, January 23, 2002, at 09:40  AM, gidadoifiok wrote:

> I'm very new to antlr (and lexing/parsing).  I wanted
> to define a rule for a quote-string.
>
> I tried:
>
>     STRING_LITERAL_SINGLE_QUOTE
> 	:	'\''! ( ~'\'' )* '\''!
> 	;
>
> However, I kept getting errors that it did not like the
> '.' in the example below:
>
>    'good.stuff'
>
> So I changed the rule to:
>
>     STRING_LITERAL_SINGLE_QUOTE
> 	:	'\''! ( '.' | ~'\'' )* '\''!
> 	;
>
> Now it works fine.  Perhaps ~'\' does not include '.'?
> I'm trying to get a grasp on all the rules, any help
> or pointers to doc is greatly appreciated.

I think this may help:

http://www.jguru.com/faq/view.jsp?EID=90

Ter
--
Chief Scientist & Co-founder, http://www.jguru.com
Creator, ANTLR Parser Generator: http://www.antlr.org


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list