[antlr-interest] Bug? "new (new" code generated.

Mark Volkmann r.mark.volkmann at gmail.com
Fri Feb 1 07:37:40 PST 2008


I think I ran into this same problem. I believe the following is a
true statement.

If your lexer grammar and parser grammar are in separate files then in
order to debug the parser grammar using ANTLRWorks, you have to use
remote debugging.

Here are the steps that work for me.

1) Modify your build script (I use Ant) to include the -debug option
when running org.antlr.Tool.
2) ant clean run (where the run target runs your application that uses
the generated classes)
3) start ANTLRWorks
4) open the parser grammar file
5) select Debugger ... Debug Remote...
6) press "Connect" button
7) use the debugger as usual

I added a wiki entry on this at
http://www.antlr.org/wiki/pages/viewpage.action?pageId=5832732.

On Feb 1, 2008 7:59 AM, Steve Bennett <stevagewp at gmail.com> wrote:
> On 2/1/08, Steve Bennett <stevagewp at gmail.com> wrote:
> > I split a working grammar into a lexer and parser. Using Antlrworks
> > 1.1.7, I now get this error:
>
> Investigating slightly, the problem is obviously that
> $java_parser_lexer$ is blank when it gets inserted in
> DBParserGlueCode.st:
>
> $java_parser_lexer$ lex = new $java_parser_lexer$(new
> ANTLRFileStream("$input_file$"));
>
> But I can't figure out what I'm doing wrong. The top of my parser file
> looks like this:
>
> parser grammar mediawiki2;
> options { tokenVocab=mediawikil; output=AST;}
>
> My lexer file looks like this:
> lexer grammar mediawikil;
>
> tokens {
> ...
>
> Any ideas, anyone?
>
> Thanks,
> Steve
>



-- 
R. Mark Volkmann
Object Computing, Inc.


More information about the antlr-interest mailing list