+ return glsl;
+}
+
+vector<Stage::Type> Compiler::get_stages() const
+{
+ vector<Stage::Type> stage_types;
+ stage_types.reserve(module->stages.size());
+ for(list<Stage>::const_iterator i=module->stages.begin(); i!=module->stages.end(); ++i)
+ stage_types.push_back(i->type);
+ return stage_types;
+}
+
+string Compiler::get_stage_glsl(Stage::Type stage_type) const
+{
+ for(list<Stage>::iterator i=module->stages.begin(); i!=module->stages.end(); ++i)
+ if(i->type==stage_type)
+ return Formatter().apply(*i);
+ throw key_error(Stage::get_stage_name(stage_type));
+}
+
+const map<string, unsigned> &Compiler::get_vertex_attributes() const
+{
+ for(list<Stage>::const_iterator i=module->stages.begin(); i!=module->stages.end(); ++i)
+ if(i->type==Stage::VERTEX)
+ return i->locations;
+ throw invalid_operation("Compiler::get_vertex_attributes");
+}
+
+const map<string, unsigned> &Compiler::get_fragment_outputs() const
+{
+ for(list<Stage>::const_iterator i=module->stages.begin(); i!=module->stages.end(); ++i)
+ if(i->type==Stage::FRAGMENT)
+ return i->locations;
+ throw invalid_operation("Compiler::get_fragment_outputs");
+}
+
+const SourceMap &Compiler::get_source_map() const
+{
+ return module->source_map;
+}
+
+string Compiler::get_stage_debug(Stage::Type stage_type) const
+{
+ for(list<Stage>::iterator i=module->stages.begin(); i!=module->stages.end(); ++i)
+ if(i->type==stage_type)
+ return DumpTree().apply(*i);
+ throw key_error(Stage::get_stage_name(stage_type));
+}
+
+string Compiler::get_diagnostics() const
+{
+ string combined;
+ for(list<Stage>::const_iterator i=module->stages.begin(); i!=module->stages.end(); ++i)
+ for(vector<Diagnostic>::const_iterator j=i->diagnostics.begin(); j!=i->diagnostics.end(); ++j)
+ if(j->source!=INTERNAL_SOURCE)
+ append(combined, "\n", format("%s:%d: %s", module->source_map.get_name(j->source), j->line, j->message));
+ return combined;