[antlr-interest] Strange bug in ANTLR version higher than 3.1.2

Sam Harwell sharwell at pixelminegames.com
Wed Nov 4 22:20:52 PST 2009


Pre-3.2 CommonTreeNodeStream got renamed to BufferedTreeNodeStream for
3.2, and the CommonTreeNodeStream now in its place is unbuffered. The
two classes expose the same API and *should* be interchangeable, but
there's a bug in the Java version that makes it not the case. The C# 3
runtime works on your code with both options.

Sam

-----Original Message-----
From: FranklinChen at cmu.edu [mailto:FranklinChen at cmu.edu] 
Sent: Thursday, November 05, 2009 12:19 AM
To: Sam Harwell
Cc: Graham Wideman; antlr-interest at antlr.org
Subject: RE: [antlr-interest] Strange bug in ANTLR version higher than
3.1.2

> For the 3.2 version, try changing this:
> 
> CommonTreeNodeStream nodes = new CommonTreeNodeStream(tree);
> 
> To this:
> 
> BufferedTreeNodeStream nodes = new BufferedTreeNodeStream(tree);

This works!

I also verified that making this simple change also works when I make
it in the driver for my large program that uses a lot of manual tree
restructuring similar to the test case I created.

Thank you very much!  Can you explain to me why the discrepancy when
moving from 3.1.2 to 3.1.3/3.2?

-- 
Franklin


More information about the antlr-interest mailing list