Patches to ANTLR 3.0.1Edit

— antlr-3.0.1/runtime/C/dist/libantlr3c-3.0.1/src/antlr3inputstream.c 2007-10-16 16:18:59.000000000 +0200 +++ antlr-3.0.1/runtime/C/dist/libantlr3c-3.0.1/src/antlr3inputstream.c 2007-10-16 16:19:30.000000000 +0200 @@ -180,7 +180,7 @@

input->nextChar = input->data; /_ Input at first character / input->line = 1; / starts at line 1 / - input->charPositionInLine = -1; + input->charPositionInLine = 0; input->currentLine = input->data; input->markDepth = 0; / Reset markers _/

— antlr-3.0.1/src/org/antlr/codegen/templates/C/C.stg 2007-10-16 19:31:23.000000000 +0200 +++ antlr-3.0.1/src/org/antlr/codegen/templates/C/C.stg 2007-10-16 19:31:38.000000000 +0200 @@ -53,7 +53,6 @@ _ This file was generated by $ANTLR version _ _ - From the grammar source file : - _ - On : <if(LEXER)> * - for the lexer : Lexer — antlr-3.0.1/src/org/antlr/codegen/CodeGenerator.java 2007-10-16 16:21:05.000000000 +0200 +++ antlr-3.0.1/src/org/antlr/codegen/CodeGenerator.java 2007-10-16 16:22:04.000000000 +0200 @@ -298,7 +298,8 @@ }

boolean filterMode = grammar.getOption("filter")!=null && - grammar.getOption("filter").equals("true"); + grammar.getOption("filter").equals("true") && + ( grammar.type==Grammar.LEXER ); boolean canBacktrack = grammar.getSyntacticPredicates()!=null || filterMode;