[prev in list] [next in list] [prev in thread] [next in thread] 

List:       antlr-interest
Subject:    [antlr-interest] Fun with ANTLR3: mystery of the huge lexer
From:       antlr () mirality ! co ! nz (Gavin Lambert)
Date:       2007-06-30 23:59:34
Message-ID: 20070630235942.959E511EBDF () www ! antlr ! org
[Download RAW message or body]

At 11:12 1/07/2007, David Piepgrass wrote:
 >It's too bad I can't assign "priorities" to each rule. I
 >would like to match /* as a comment whenever possible, with
 >/regular-expressions/ having the next-highest priority and
 >PUNC having the lowest.

Lexer rules are implicitly assigned priorities based on what order 
they appear in the grammar -- rules that appear first are 
preferred over ones that are listed later.

Having said that, I think there's also a longest-match-wins rule 
too, and I'm not sure how they interact.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic