[antlr-interest] Lexer rule problem - ANTLR 2.7.7

Mark Edgeworth mark.edgeworth at scarletcode.co.uk
Thu Jan 31 10:14:07 PST 2008


Hi,

Thanks Jim for a note on a solution to this.  However, is it possible to
detect this condition pre-code generation and hence avoid a runtime error
when the developer happens to use the right (wrong?) data. 

As a relatively new user of ANTLR I have spent literally ages on just this
sort of issue recently.  ANTLR is a great tool and just so powerful, but
will often accept 'unusual' grammar constructs from newbies like me that can
never work properly.  Any extra build time checks are worth their weight in
gold to me as I learn... (ie 'lint' for .g files?)

Ta,

Mark Edgeworth

This is in response to Clive Hill's original question which starts:
>>
>>I have a lexer rule that is meant to match a range of integers or
>>numbers in the following style format: 
>>
>>5800:6000 
>>or 
>>1.8:2.0 
>> snip...snip



More information about the antlr-interest mailing list