X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fvisitor.h;fp=source%2Fglsl%2Fvisitor.h;h=4e48a1a11f112205ec10feedf2017d6c7099ddd1;hb=30465dd3b9f55ec42c4b19c3c2077eede7237a26;hp=a26e785c741e3b97e643d78f6353742feca04dd2;hpb=a47639620c40397939ae4d79c08d5d8f460bad5c;p=libs%2Fgl.git diff --git a/source/glsl/visitor.h b/source/glsl/visitor.h index a26e785c..4e48a1a1 100644 --- a/source/glsl/visitor.h +++ b/source/glsl/visitor.h @@ -9,6 +9,7 @@ namespace Msp { namespace GL { namespace SL { +/** Base class for all node visitors. */ class NodeVisitor { protected: @@ -42,6 +43,7 @@ public: virtual void visit(Jump &) { } }; +/** An intermediate base visitor class which traverses the syntax tree. */ class TraversingVisitor: public NodeVisitor { protected: @@ -69,6 +71,7 @@ public: virtual void visit(Return &); }; +/** Gathers nodes of a particular type from the syntax tree. */ template class NodeGatherer: private TraversingVisitor { @@ -82,6 +85,7 @@ private: virtual void visit(T &n) { nodes.push_back(&n); } }; +/** Removes a set of nodes from the syntax tree. */ class NodeRemover: private TraversingVisitor { private: