X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fprogramcompiler.h;h=be2afab6fdd4d5746c5605aa8c1e9e1ea9707146;hp=6b1e1cdafe79f9be2ad0df6858cd89b95942e859;hb=4b4d2a48048268d2ad48bafbce8647af8088573f;hpb=6dc2da27f0831d4172fcfeba4900616fd6c844b8 diff --git a/source/programcompiler.h b/source/programcompiler.h index 6b1e1cda..be2afab6 100644 --- a/source/programcompiler.h +++ b/source/programcompiler.h @@ -158,13 +158,6 @@ private: virtual void visit(ProgramSyntax::Passthrough &); }; - struct VariableRenamer: Visitor - { - using Visitor::visit; - virtual void visit(ProgramSyntax::VariableReference &); - virtual void visit(ProgramSyntax::VariableDeclaration &); - }; - struct DeclarationReorderer: Visitor { enum DeclarationKind @@ -370,20 +363,24 @@ private: }; Resources *resources; - ProgramParser parser; ProgramSyntax::Module *module; + std::set imported_names; public: ProgramCompiler(); + ~ProgramCompiler(); - void compile(const std::string &); - void compile(IO::Base &, Resources * = 0); + void compile(const std::string &, const std::string & = ""); + void compile(IO::Base &, Resources * = 0, const std::string & = ""); + void compile(IO::Base &, const std::string &); void add_shaders(Program &); private: static ProgramSyntax::Module *create_builtins_module(); static ProgramSyntax::Module &get_builtins_module(); static ProgramSyntax::Stage *get_builtins(ProgramSyntax::StageType); + void append_module(ProgramSyntax::Module &); + void append_stage(ProgramSyntax::Stage &); void process(); void import(const std::string &); void generate(ProgramSyntax::Stage &);