[antlr-interest] ANTLRWorks question

Indhu Bharathi indhu.b at s7software.com
Tue Oct 13 11:10:25 PDT 2009


Prefer using debugger instead of interpreter. Interpreter doesn't work as
expected sometimes (when you are using semantic predicates).

 

That said, for this particular case it seems to works fine.

 

r              :               STRING

                ;

                

STRING

    :  '"' ( ~('\\'|'"') )* '"'

    ;

 

Are you using semantic predicates somewhere else that causes the interpreter
to fail?

 

BTW, what is the error message you get?

 

Cheers, Indhu

 

 

From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Mark Wilson
Sent: Tuesday, October 13, 2009 11:34 PM
To: antlr-interest at antlr.org
Subject: [antlr-interest] ANTLRWorks question

 

I used the ANTLRWorks wizard to start my grammar.  There appears to be
something wrong with the STRING token, basically something like "Joe" does
not parse correctly in the interpreter.  This is what the rule looks like:

STRING
    :  '"' ( ESC_SEQ | ~('\\'|'"') )* '"'
    ;

What is this supposed to do?  

Thanks,
Mark Wilson

-- 
Mark Wilson

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20091013/10bf6810/attachment.html 


More information about the antlr-interest mailing list