[antlr-interest] Lexer question: Matchin everything up to a specifc token or EOF?

Peter Palotas peter.palotas at gmail.com
Tue Jul 25 07:00:39 PDT 2006


Hi,

I want my lexer to macth any character up until a specific sequence of
characters, say "<?", or EOF.

Tried the rule:

PCDATA
    : ( options
         { greedy=false; }
         :  .
         )* ("<?")?
         ;

Which keeps matching nothing forever, so that wasn't very good. And matching
the EOF char doesn't seem to be possible, or? Any pointers on how to
accomplish this?

// Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060725/982eb67a/attachment.html


More information about the antlr-interest mailing list