1 #ifndef MSP_GL_PROGRAMCOMPILER_H_
2 #define MSP_GL_PROGRAMCOMPILER_H_
4 #include "programparser.h"
5 #include "programsyntax.h"
15 struct Formatter: ProgramSyntax::NodeVisitor
17 std::string formatted;
24 std::string format_expression(ProgramSyntax::Expression &);
25 virtual void visit(ProgramSyntax::Block &);
26 virtual void visit(ProgramSyntax::ExpressionStatement &);
27 virtual void visit(ProgramSyntax::Layout &);
28 virtual void visit(ProgramSyntax::StructDeclaration &);
29 virtual void visit(ProgramSyntax::VariableDeclaration &);
30 virtual void visit(ProgramSyntax::InterfaceBlock &);
31 virtual void visit(ProgramSyntax::FunctionDeclaration &);
32 virtual void visit(ProgramSyntax::Conditional &);
33 virtual void visit(ProgramSyntax::Iteration &);
34 virtual void visit(ProgramSyntax::Return &);
39 ProgramSyntax::Module *module;
44 void compile(const std::string &);
45 void compile(IO::Base &);
46 void add_shaders(Program &);
49 std::string format_context(ProgramSyntax::Context &);