[antlr-interest] BaseAST *sob* *sob* (Hi Terence)

Akhilesh Mritunjai virtualaspirin at yahoo.com
Mon Oct 3 09:13:04 PDT 2005


Hi Terence

Please please tell me you didn't code BaseAST class.


Ok, now my grudge against that class. After perfectly
fine declarations in AST interface of tree walking
methods, this class goes and implements what seems to
be common 'algorithms'. But instead of using available
interface, it defines fields ('down' and 'right') and
uses them liberally throughout the code.

And, now, here I am. I tried making a node class that
dissociates the logic of keeping track of
child/sibling /nodes (in short, I implemented a
mechanism for demand paging the tree or fragments
thereof), which, (no prizes for guessing), failed
miserably because in this implementation BaseAST.right
and BaseAST.down are always null (the magic of
figuring out and fetching child/sibling is elsewhere).

Now I am crying in pain after debugging for two days
why the parse tree after my magic is missing about 10%
of nodes. Tell me what I should do to make it right.
Please don't tell me to fork the ANTLR code base.

The only option I have right now is to drag myself to
the bar next door, get drunk and forget for the
meanwhile that this issue exists :=(

*sob* *sob*

- Akhilesh



	
		
______________________________________________________ 
Yahoo! for Good 
Donate to the Hurricane Katrina relief effort. 
http://store.yahoo.com/redcross-donate3/ 



More information about the antlr-interest mailing list