[antlr-interest] Spaces issues

Jim Idle jimi at temporal-wave.com
Tue Mar 29 11:16:25 PDT 2011


Did you use the debugger instead of the interpreter?

Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Fabien Hermenier
> Sent: Tuesday, March 29, 2011 10:37 AM
> To: antlr-interest at antlr.org
> Subject: Re: [antlr-interest] Spaces issues
>
> Le 29/03/11 07:36, John B. Brodie a écrit :
> > Greetings!
> >
> > On Tue, 2011-03-29 at 00:47 -0600, Fabien Hermenier wrote:
> >> Hi
> >>
> >> I starting to use ANTLR3 with AntlrWorks 3.4.1 on OS X and I have
> >> some issues with spaces. I've attached a sample antlr file
> describing
> >> my grammar (see 1st grammar)
> >>
> >> I'm trying to test 'litteralRange'. So using the interpreter, I
> write
> >> "[2 ..3]" or "[2 .. 3]" as input and it works fine. However, if I
> >> give the string "[2..3]" it does not work. I have followed the
> >> tutorial and declare the Lexer WS with the channel hidden to ignore
> >> spaces, but I still have strange issues with this.
> >>
> >> Another strange fact is that if I write a reduced grammar that just
> >> isolate the rule I want to test, it is fine (see 2nd grammar).
> >>
> >> Does anyone have a solution or a hint ?
> >>
> > ....good stuff snipped....
> >
> > see Jim Idle's WIKI entry:
> >
> > http://www.antlr.org/wiki/display/ANTLR3/Lexer+grammar+for+floating
> > +point%2C+dot%2C+range%2C+time+specs
> >
> > (the above url is supposed to be all on 1 line without white space)
> >
> > Hope this helps...
> >     -jbb
> >
> >
> Thanks, I still have a question. I understand how it is difficult to
> capture '..' while having to bother with float numbers such as ".3".
> But in my case, I only have to deal with integer values, so currently I
> don't see why I need to help the Lexer.
> I have reduced the number of fragments following the principle of the
> link you sent to me (to catch in a single rule numbers in base 10, 16
> or
> 8) but
> it didn't solve my problem yet.
>
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address


More information about the antlr-interest mailing list