]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/output.h
Further refactor the resolving process in SL::Compiler
[libs/gl.git] / source / glsl / output.h
index 5f741909062f2f9ada8fce46ae0fc7fe3502e02c..69a99d1e5e67979f9dddcd48d5db4c236ce5882e 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef MSP_GL_SL_OUTPUT_H_
 #define MSP_GL_SL_OUTPUT_H_
 
+#include "compiler.h"
 #include "syntax.h"
 #include "visitor.h"
 
@@ -8,10 +9,12 @@ namespace Msp {
 namespace GL {
 namespace SL {
 
+/** Formats the syntax tree as GLSL. */
 class Formatter: private TraversingVisitor
 {
 private:
        Stage *stage;
+       Compiler::Mode mode;
        std::string formatted;
        unsigned source_index;
        unsigned source_line;
@@ -22,7 +25,7 @@ private:
 public:
        Formatter();
 
-       const std::string &apply(Stage &);
+       const std::string &apply(Stage &, Compiler::Mode);
        const std::string &apply(Node &n) { n.visit(*this); return formatted; }
 
 private:
@@ -34,6 +37,7 @@ private:
        virtual void visit(Literal &);
        virtual void visit(ParenthesizedExpression &);
        virtual void visit(VariableReference &);
+       virtual void visit(InterfaceBlockReference &);
        virtual void visit(MemberAccess &);
        virtual void visit(UnaryExpression &);
        virtual void visit(BinaryExpression &);
@@ -50,9 +54,9 @@ private:
        virtual void visit(FunctionDeclaration &);
        virtual void visit(Conditional &);
        virtual void visit(Iteration &);
+       virtual void visit(Passthrough &);
        virtual void visit(Return &);
        virtual void visit(Jump &);
-       using TraversingVisitor::visit;
 };
 
 } // namespace SL