X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fglsl%2Fvisitor.h;h=83b310f62ebadbcef621a9b8d1aa65eb571e59c1;hb=3f899b1fc2e04f4fe74c99ad3e8ebb900c257214;hp=a26e785c741e3b97e643d78f6353742feca04dd2;hpb=bd8816692056230c36504dcccd76c6946dff47b1;p=libs%2Fgl.git diff --git a/source/glsl/visitor.h b/source/glsl/visitor.h index a26e785c..83b310f6 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: @@ -102,6 +106,7 @@ private: virtual void visit(StructDeclaration &); virtual void visit(VariableDeclaration &); virtual void visit(InterfaceBlock &); + virtual void visit(FunctionDeclaration &); virtual void visit(Iteration &); };