[antlr-interest] Lexer for a grammar similar to a template engine

Joan Pujol jo at joanpujol.cat
Sun Oct 11 13:48:02 PDT 2009


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


More information about the antlr-interest mailing list