[antlr-interest] Antlr 2.7.2a2 Report

Robert Colquhoun rjc at trump.net.au
Wed Feb 6 03:25:51 PST 2002


I have been using 2.7.2a2 for the last couple of weeks, overall it has been 
working well.  antlr.Tool seems to parse grammar files much faster, 
generated code all seems to be working just fine.

Anyway 3 kindof small points:

1) This is a totally trivial thing, but when generating bitsets in the lexer:

   private static final long[] mk_tokenSet_1() {
         long[] data = new long[8];
         for (int i = 1; i<=3; i++) { data[i]=-1L; }
         for (int i = 4; i<=7; i++) { data[i]=0L; }
         return data;

Initializing the array to 0L is not needed as java does this 
automatically(only matters for unicode with lots of bitsets, and even then 
not much).

2) Exception constructor prototypes have changed.  I am not sure if i was 
supposed to be using these but in my grammar in a couple of places i needed 
to throw SemanticException's which now have a different prototype that 
includes the column number....i was wondering if for backwards 
compatibility could the old prototype(perhaps with @deprecated) so that 
2.7.2 is binary compatible with 2.7.1

3) In the BASIC parser i have been working on it is quite common for the 
BASIC programs to have a variable 'EOF'....this does not work at all with 
antlr which internally automatically defines the text for EOF token to 
"EOF" which causes an automatic match when looking up keywords.....i think 
this would also affect other languages.

ie  could the java grammar parse something like:
	class Test {
		public final static int EOF = -1;

  - Robert


Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

More information about the antlr-interest mailing list