[antlr-interest] lexer problem

Ruth Karl ruth.karl at gmx.de
Wed Jul 25 12:28:49 PDT 2007


Dear all,

I have been trying in vain to find a solution for the following lexer 
problem with the attached grammar:

if I give it '<xxx>' as an input, it works correctly (interpreting it as 
an htmltag with xxx as text content);

while if i give it '<s>' it doesn't. In AnTLRWorks it results in an 
empty document, and the generated lexer (C#) throws a 
Antlr.Runtime.MismatchedTokenException trying to match "<script"...

(if i give it '< s>' though, there is no problem).

The lexer rule that is invoked is:
    JAVASCRIPT    :    '<script' ( options {greedy=false;} : . )* 
'</script>'    ;   

but with k=3 this problem I thought this should not happen. It did not 
help to turn on backtrack option either.
What am I missing? Could someone please help?

Thanks a lot,

Ruth

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: JSP.g
Url: http://www.antlr.org/pipermail/antlr-interest/attachments/20070725/6cfa6868/attachment.pl 


More information about the antlr-interest mailing list