[antlr-interest] ANTLRWorks and separate lexer/parser grammars - pleading?

Mark Volkmann r.mark.volkmann at gmail.com
Fri Jan 18 12:55:55 PST 2008


On Jan 18, 2008 2:29 PM, Terence Parr <parrt at cs.usfca.edu> wrote:
> run -debug on the parser grammar from command line.

Okay, I added the "-debug" option when running org.antlr.Tool on my
grammar files.

> compile.  start

The code generated with -debug compiles fine, but when I run it I get

Exception in thread "main" java.lang.NullPointerException at
org.antlr.runtime.debug.DebugTokenStream.<init>(DebugTokenStream.java:45)

Do I have to do something different in my code that uses the generated classes?

If I generate code without -debug and run it, everything is fine.

> up.  run AW's "debug remote..." and joy shall be yours!

I found the wiki page
http://www.antlr.org/wiki/pages/viewpage.action?pageId=4554898 that
documents using remote debugging. It says "the simple driver class to
exercise the parser is slightly different", but I don't see anything
special going on in that code.

> Ter
>
> On Jan 18, 2008, at 12:04 PM, Mark Volkmann wrote:
>
> > Is it okay to plead for help? If so, I'm pleading! ;-)
> >
> > I have a grammar that is split into three grammar files ... lexer,
> > parser and tree parser. I really want to use the ANTLRWorks debugger
> > to debug AST creation in the parser grammar, but I can only get that
> > to work if I combine the grammar files for the lexer and parser into
> > one. Either ANTLRWorks can do what I want or there's a trick to set
> > this up.
> >
> > Has anybody done this? Is Jean Bovet out there?
> >
> > --
> > R. Mark Volkmann
> > Object Computing, Inc.
>
>



-- 
R. Mark Volkmann
Object Computing, Inc.


More information about the antlr-interest mailing list