...
var tokens = new CommonTokenStream(lexer);
var parser = new LDBParser(tokens);
parser.Trace = true; <------------- added this
var listener = new ErrorListener<IToken>(parser, lexer, tokens);
...
When you set .trace to true , the tracing listener it has does
not have a stream set, so it throws a null pointer exception. If
you put your own Trace Listener, which you construct from the
consturctor, it does not have a reference to a parser. Link
to faulty code. You will have to set the private field
_enclosing (when you create a TraceListener) or Output,(if you use
the original tracer).
--
You received this message because you are subscribed to the Google Groups "antlr-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to antlr-discussi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/antlr-discussion/2a0c2124-ead3-4167-9781-67921a18d779o%40googlegroups.com.