]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/parser.h
Fix a name conflict in certain inlining scenarios
[libs/gl.git] / source / glsl / parser.h
index c98867a3791e866ecd31a9c7cc5076e7443482cf..a935356ecd1339e68e6bb82f2752a5d47e6a25fb 100644 (file)
@@ -12,9 +12,12 @@ namespace Msp {
 namespace GL {
 namespace SL {
 
+class ModuleCache;
+
 class Parser
 {
 private:
+       ModuleCache *mod_cache;
        std::string source;
        int base_index;
        int source_index;
@@ -22,16 +25,17 @@ private:
        Preprocessor preprocessor;
        bool allow_stage_change;
        Module *module;
+       std::vector<const Module *> imported_modules;
        Stage *cur_stage;
-       std::set<std::string> declared_types;
+       std::set<std::string> global_types;
+       std::set<std::string> stage_types;
        std::vector<std::string> errors;
 
 public:
-       Parser();
-       ~Parser();
+       Parser(ModuleCache *);
 
-       Module &parse(const std::string &, const std::string &, int);
-       Module &parse(IO::Base &, const std::string &, int);
+       void parse(Module &, const std::string &, const std::string &, int);
+       void parse(Module &, IO::Base &, const std::string &, int);
 
 private:
        void parse_source(const std::string &, int);