1 #ifndef MSP_GL_SL_OUTPUT_H_
2 #define MSP_GL_SL_OUTPUT_H_
12 /** Formats the syntax tree as GLSL. */
13 class Formatter: private TraversingVisitor
17 std::string formatted;
18 unsigned source_index;
28 std::string apply(Stage &);
31 void append(const std::string &);
33 void set_source(unsigned, unsigned);
35 virtual void visit(Block &);
36 void visit_expression(Expression &, const Operator *, bool);
37 virtual void visit(Literal &);
38 virtual void visit(VariableReference &);
39 virtual void visit(InterfaceBlockReference &);
40 virtual void visit(MemberAccess &);
41 virtual void visit(Swizzle &);
42 virtual void visit(UnaryExpression &);
43 virtual void visit(BinaryExpression &);
44 virtual void visit(Assignment &);
45 virtual void visit(TernaryExpression &);
46 virtual void visit(FunctionCall &);
47 virtual void visit(ExpressionStatement &);
48 virtual void visit(Import &);
49 virtual void visit(Precision &);
50 virtual void visit(Layout &);
51 virtual void visit(InterfaceLayout &);
52 virtual void visit(StructDeclaration &);
53 virtual void visit(VariableDeclaration &);
54 virtual void visit(InterfaceBlock &);
55 virtual void visit(FunctionDeclaration &);
56 virtual void visit(Conditional &);
57 virtual void visit(Iteration &);
58 virtual void visit(Passthrough &);
59 virtual void visit(Return &);
60 virtual void visit(Jump &);