namespace GL {
namespace SL {
+/** Base class for all node visitors. */
class NodeVisitor
{
protected:
virtual void visit(Jump &) { }
};
+/** An intermediate base visitor class which traverses the syntax tree. */
class TraversingVisitor: public NodeVisitor
{
protected:
virtual void visit(Return &);
};
+/** Gathers nodes of a particular type from the syntax tree. */
template<typename T>
class NodeGatherer: private TraversingVisitor
{
virtual void visit(T &n) { nodes.push_back(&n); }
};
+/** Removes a set of nodes from the syntax tree. */
class NodeRemover: private TraversingVisitor
{
private: