[prev in list] [next in list] [prev in thread] [next in thread]
List: antlr-interest
Subject: Re: [antlr-interest] RE Lexer rule for number range matching ?
From: Gavin Lambert <antlr () mirality ! co ! nz>
Date: 2008-04-25 2:58:01
Message-ID: 20080425025818.E865811ED04 () www ! antlr ! org
[Download RAW message or body]
At 05:52 25/04/2008, Nagesh, Harsha wrote:
>
>I tried these suggestions, but I am getting the following
warning
>in ANTLRWorks when I include this rule
>
>"The following token definitions are unreachable:.."
You've probably got another lexer rule that matches sequences of
digits. Remember, the lexer is contextless, so if you have other
possibilities for digit groups you can't do the range-checking in
the lexer. You need to make a general-purpose NUMBER rule in the
lexer and do your range checking in the parser instead.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic