]> git.tdb.fi Git - libs/gl.git/blobdiff - source/programparser.h
Refresh lighting and culling uniforms if the camera changes in pop_state
[libs/gl.git] / source / programparser.h
index 1ca1a44c564d7aa8e6e65ed5f37e465b6a3f2340..0a46c09ece6202e18c71625afd916b8680f4806a 100644 (file)
@@ -39,19 +39,21 @@ private:
        std::string source;
        std::string::const_iterator iter;
        std::deque<std::string> next_tokens;
-       ProgramSyntax::Module main_module;
-       ProgramSyntax::Module *cur_module;
+       ProgramSyntax::Module *module;
        ProgramSyntax::Stage *cur_stage;
        std::set<std::string> declared_types;
 
        static Operator operators[];
 
 public:
+       ProgramParser();
+       ~ProgramParser();
+
        ProgramSyntax::Module &parse(const std::string &);
        ProgramSyntax::Module &parse(IO::Base &);
 
 private:
-       void parse_source(ProgramSyntax::Module &);
+       void parse_source();
 
        const std::string &peek_token(unsigned = 0);
        std::string parse_token();
@@ -72,22 +74,22 @@ private:
        bool is_type(const std::string &);
        bool is_identifier(const std::string &);
 
-       ProgramSyntax::Node *parse_global_declaration();
-       ProgramSyntax::Node *parse_statement();
-       ProgramSyntax::Layout *parse_layout();
+       RefPtr<ProgramSyntax::Node> parse_global_declaration();
+       RefPtr<ProgramSyntax::Node> parse_statement();
+       RefPtr<ProgramSyntax::Import> parse_import();
+       RefPtr<ProgramSyntax::Layout> parse_layout();
        void parse_block(ProgramSyntax::Block &, bool);
-       ProgramSyntax::Expression *parse_expression(unsigned = 0);
-       ProgramSyntax::BinaryExpression *parse_binary(ProgramSyntax::Expression *, const Operator *);
-       ProgramSyntax::FunctionCall *parse_function_call(ProgramSyntax::VariableReference *);
-       ProgramSyntax::StructDeclaration *parse_struct_declaration();
-       ProgramSyntax::VariableDeclaration *parse_variable_declaration();
-       ProgramSyntax::FunctionDeclaration *parse_function_declaration();
-       void parse_function_parameter_list(ProgramSyntax::FunctionDeclaration &);
-       ProgramSyntax::InterfaceBlock *parse_interface_block();
-       ProgramSyntax::Conditional *parse_conditional();
-       ProgramSyntax::Iteration *parse_iteration();
-       ProgramSyntax::Passthrough *parse_passthrough();
-       ProgramSyntax::Return *parse_return();
+       RefPtr<ProgramSyntax::Expression> parse_expression(unsigned = 0);
+       RefPtr<ProgramSyntax::BinaryExpression> parse_binary(const RefPtr<ProgramSyntax::Expression> &, const Operator *);
+       RefPtr<ProgramSyntax::FunctionCall> parse_function_call(const ProgramSyntax::VariableReference &);
+       RefPtr<ProgramSyntax::StructDeclaration> parse_struct_declaration();
+       RefPtr<ProgramSyntax::VariableDeclaration> parse_variable_declaration();
+       RefPtr<ProgramSyntax::FunctionDeclaration> parse_function_declaration();
+       RefPtr<ProgramSyntax::InterfaceBlock> parse_interface_block();
+       RefPtr<ProgramSyntax::Conditional> parse_conditional();
+       RefPtr<ProgramSyntax::Iteration> parse_iteration();
+       RefPtr<ProgramSyntax::Passthrough> parse_passthrough();
+       RefPtr<ProgramSyntax::Return> parse_return();
 };
 
 } // namespace GL