Hi Gavin,

When I looked at your grammar it seemed correct to me but I tested it
in ANTLRWorks and I can't see why it doesn't work.

If you test with input "Hello ${name} it gives me a lexer error: line
1:7 mismatched character '{' expecting set null

I've looked at generated code and I see that when the lexer enters at
mTEXT rule it only can exit (correctly) if it reaches the end of
input.
And I don't understand why. I suppose that is something with the new
ANTLR3 lexers, or that I've to refresh some parsing theory, but I'm
absolutely lost.

A lot of thanks in advance,




On Sun, Oct 11, 2009 at 10:48 PM, Joan Pujol <j...@joanpujol.cat> wrote:
> Thanks Gavin and Graham,
>
> Gavin:
> But when you say that you can further evaluate at parser level what do you 
> mean?
> What do you say is use another lexer+parser to parse the STRINGs
> tokens, doesn't you? Because the expressions will be a lot more
> complex to be parsed without prior lexer separation of tokens.
>
> Graham:
> You're right, I've corrected what you say changing the AND but what I
> don't understand is why if I put an input of for example:
> 'Hello?  --> It works.
> But If I put "Hello ${" it enters in infinite recursion saying:
> line 1:5 rule OTHER failed predicate: {input.LA(1)!='$' ||
> input.LA(2)!='{'}? infinite times.
>
>
> Cheers,
>
> --
> Joan Jesús Pujol Espinar
> http://www.joanpujol.cat
> http://lujop.deviantart.com
>



-- 
Joan Jesús Pujol Espinar
http://www.joanpujol.cat
http://lujop.deviantart.com

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-interest@googlegroups.com
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to