X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Foutput.h;h=0a506a5d9e15b2080a392eb5ef628730683d9de7;hb=3e24a1bfd5a259b185ff0f37046dd0489e1908a3;hp=5b03420223c3f70fb57f7f900f6708e2da5efe39;hpb=0ca367ce305ae6f2025739b3b199a7f75d4132db;p=libs%2Fgl.git diff --git a/source/glsl/output.h b/source/glsl/output.h index 5b034202..0a506a5d 100644 --- a/source/glsl/output.h +++ b/source/glsl/output.h @@ -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,6 +9,7 @@ namespace Msp { namespace GL { namespace SL { +/** Formats the syntax tree as GLSL. */ class Formatter: private TraversingVisitor { private: @@ -17,12 +19,13 @@ private: unsigned source_line; unsigned indent; bool parameter_list; - std::string block_interface; + bool omit_builtin; public: Formatter(); const std::string &apply(Stage &); + const std::string &apply(Node &n) { n.visit(*this); return formatted; } private: void append(const std::string &); @@ -33,7 +36,9 @@ private: virtual void visit(Literal &); virtual void visit(ParenthesizedExpression &); virtual void visit(VariableReference &); + virtual void visit(InterfaceBlockReference &); virtual void visit(MemberAccess &); + virtual void visit(Swizzle &); virtual void visit(UnaryExpression &); virtual void visit(BinaryExpression &); virtual void visit(Assignment &); @@ -49,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