X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Foutput.h;h=ef9369876b46c00221ad6e33093c6e76153fee93;hb=dfcf8ebc329b79c369b88bdbeb982480aa5fc12a;hp=5f741909062f2f9ada8fce46ae0fc7fe3502e02c;hpb=ede0bc3f5c7124ef100576ad4b0890c9cd13c79d;p=libs%2Fgl.git diff --git a/source/glsl/output.h b/source/glsl/output.h index 5f741909..ef936987 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,7 +19,8 @@ private: unsigned source_line; unsigned indent; bool parameter_list; - std::string block_interface; + bool omit_builtin; + bool r_empty_name; public: Formatter(); @@ -31,13 +34,16 @@ private: void set_source(unsigned, unsigned); virtual void visit(Block &); + void visit_expression(Expression &, const Operator *, bool); 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 &); + virtual void visit(TernaryExpression &); virtual void visit(FunctionCall &); virtual void visit(ExpressionStatement &); virtual void visit(Import &); @@ -50,9 +56,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