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 = 0;
19 unsigned source_line = 1;
21 bool parameter_list = false;
22 bool omit_builtin = false;
23 bool r_empty_name = false;
26 std::string apply(Stage &);
29 void append(const std::string &);
31 void set_source(unsigned, unsigned);
33 virtual void visit(Block &);
34 void visit_expression(Expression &, const Operator *, bool);
35 virtual void visit(Literal &);
36 virtual void visit(VariableReference &);
37 virtual void visit(MemberAccess &);
38 virtual void visit(Swizzle &);
39 virtual void visit(UnaryExpression &);
40 virtual void visit(BinaryExpression &);
41 virtual void visit(Assignment &);
42 virtual void visit(TernaryExpression &);
43 virtual void visit(FunctionCall &);
44 virtual void visit(ExpressionStatement &);
45 virtual void visit(Import &);
46 virtual void visit(Precision &);
47 virtual void visit(Layout &);
48 virtual void visit(InterfaceLayout &);
49 virtual void visit(StructDeclaration &);
50 virtual void visit(VariableDeclaration &);
51 virtual void visit(FunctionDeclaration &);
52 virtual void visit(Conditional &);
53 virtual void visit(Iteration &);
54 virtual void visit(Passthrough &);
55 virtual void visit(Return &);
56 virtual void visit(Jump &);