]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/parser.h
Check the flat qualifier from the correct member
[libs/gl.git] / source / glsl / parser.h
index c98867a3791e866ecd31a9c7cc5076e7443482cf..51616378c29c947653496ca71be80640081e55f4 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,18 @@ 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;
+       RefPtr<Statement> next_global_declaration;
 
 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);
@@ -75,6 +80,7 @@ private:
        RefPtr<BinaryExpression> parse_binary(const RefPtr<Expression> &, const Operator &);
        RefPtr<TernaryExpression> parse_ternary(const RefPtr<Expression> &, const Operator &);
        RefPtr<FunctionCall> parse_function_call(const VariableReference &);
+       void add_type(TypeDeclaration &);
        RefPtr<TypeDeclaration> parse_type_declaration();
        RefPtr<BasicTypeDeclaration> parse_basic_type_declaration();
        RefPtr<ImageTypeDeclaration> parse_image_type_declaration();
@@ -82,7 +88,7 @@ private:
        RefPtr<VariableDeclaration> parse_variable_declaration();
        RefPtr<VariableDeclaration> parse_variable_declaration_with_layout();
        RefPtr<FunctionDeclaration> parse_function_declaration();
-       RefPtr<InterfaceBlock> parse_interface_block();
+       RefPtr<StructDeclaration> parse_interface_block();
        RefPtr<Conditional> parse_conditional();
        RefPtr<Iteration> parse_for();
        RefPtr<Iteration> parse_while();