[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Non-member submission from [Othman Alaoui <oalaou@po-box.mcgill.ca>]

> From: Othman Alaoui <oalaou@po-box.mcgill.ca>
> The following code does something similar in Java for SableCC, for an
> argument list of a function, except that it replaces the function
> subtree itself. That's if I understood correctly the purpose of your code...
> correct me otherwise.

That looks similar (and is a lot better than the code I used in my
interpreter, if I remember correctly).  I suspect it is also safer - the
code I posted had a bug in it which only showed up later as a run-time
error.... :-).  On the other hand, it's not (to my eye) quite as clear
(ie "high-level") (you have to look at the node.replaceBy line to see
that it is a tree-changing piece of code, for example).