francis maes
2009-01-10 19:17:27 UTC
* New baseclass "RewriteVisitor" whose default implementation clones a
PTree (file RewriteVisitor.h). I use this base class for all the
visitors that perform source-to-source transformation.
Can you describe in what way the existing Visitor base class isn't genericPTree (file RewriteVisitor.h). I use this base class for all the
visitors that perform source-to-source transformation.
enough for your needs ?
implementation simply clone the visited PTree, without loosing the
type of the PTree::Nodes:
PTree* clone(PTree* tree) {return RewriteVisitor().rewrite(tree);}
In order to perform source-to-source transformation, I inherit from
RewriteVisitor and override only the visit functions corresponding to
the nodes that have to be rewritten differently.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: RewriteVisitor.h
Url: http://lists.fresco.org/pipermail/synopsis-devel/attachments/20090110/c70fa904/attachment.txt