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
18 std::string formatted;
19 unsigned source_index;
23 std::string block_interface;
28 const std::string &apply(Stage &, Compiler::Mode);
29 const std::string &apply(Node &n) { n.visit(*this); return formatted; }
32 void append(const std::string &);
34 void set_source(unsigned, unsigned);
36 virtual void visit(Block &);
37 virtual void visit(Literal &);
38 virtual void visit(ParenthesizedExpression &);
39 virtual void visit(VariableReference &);
40 virtual void visit(InterfaceBlockReference &);
41 virtual void visit(MemberAccess &);
42 virtual void visit(UnaryExpression &);
43 virtual void visit(BinaryExpression &);
44 virtual void visit(Assignment &);
45 virtual void visit(FunctionCall &);
46 virtual void visit(ExpressionStatement &);
47 virtual void visit(Import &);
48 virtual void visit(Precision &);
49 virtual void visit(Layout &);
50 virtual void visit(InterfaceLayout &);
51 virtual void visit(StructDeclaration &);
52 virtual void visit(VariableDeclaration &);
53 virtual void visit(InterfaceBlock &);
54 virtual void visit(FunctionDeclaration &);
55 virtual void visit(Conditional &);
56 virtual void visit(Iteration &);
57 virtual void visit(Passthrough &);
58 virtual void visit(Return &);
59 virtual void visit(Jump &);