X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fparser.h;h=e087f27f9d0578bd6e23be8fee0c44e841cd3cb3;hb=f901fcf41d8ca544085f448227f84bc6f966660d;hp=26867ec4dcd881230229b253927457ba1f1a72d7;hpb=4c805f55d89919d6971d600102ab4d6d65d56dc3;p=libs%2Fgl.git diff --git a/source/glsl/parser.h b/source/glsl/parser.h index 26867ec4..e087f27f 100644 --- a/source/glsl/parser.h +++ b/source/glsl/parser.h @@ -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; @@ -27,11 +30,10 @@ private: std::vector 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); @@ -70,8 +72,10 @@ private: RefPtr parse_layout(); template void parse_block(Block &, bool, RefPtr (Parser::*)()); - RefPtr parse_expression(unsigned = 0); + RefPtr parse_expression(const Operator * = 0); + RefPtr parse_literal(); RefPtr parse_binary(const RefPtr &, const Operator &); + RefPtr parse_ternary(const RefPtr &, const Operator &); RefPtr parse_function_call(const VariableReference &); RefPtr parse_type_declaration(); RefPtr parse_basic_type_declaration();