X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fprogramparser.h;h=707815405684252f1fc06c33341ea19b5ba5199c;hp=be6da197481aa3d264c7516427b55859e40e04d9;hb=e16855bccb78c721e2fe3f2ea8fc0310e041cb43;hpb=eb6a546dcffc1b67f0a23d8b075fbdc86a2872a0 diff --git a/source/programparser.h b/source/programparser.h index be6da197..70781540 100644 --- a/source/programparser.h +++ b/source/programparser.h @@ -40,6 +40,9 @@ private: std::string source_name; unsigned current_line; std::string::const_iterator iter; + std::string::const_iterator source_end; + bool allow_preprocess; + bool allow_stage_change; std::string last_token; std::deque next_tokens; ProgramSyntax::Module *module; @@ -67,7 +70,7 @@ private: std::string parse_identifier(); std::string parse_number(); std::string parse_other(); - bool skip_comment_and_whitespace(); + void skip_comment_and_whitespace(); void expect(const std::string &); std::string expect_type(); std::string expect_identifier(); @@ -75,12 +78,18 @@ private: static bool is_interface_qualifier(const std::string &); static bool is_sampling_qualifier(const std::string &); + static bool is_interpolation_qualifier(const std::string &); static bool is_precision_qualifier(const std::string &); static bool is_qualifier(const std::string &); static bool is_builtin_type(const std::string &); bool is_type(const std::string &); bool is_identifier(const std::string &); + void preprocess(); + void preprocess_pragma(); + void preprocess_pragma_msp(); + void preprocess_stage(); + RefPtr parse_global_declaration(); RefPtr parse_statement(); RefPtr parse_import(); @@ -95,7 +104,8 @@ private: RefPtr parse_function_declaration(); RefPtr parse_interface_block(); RefPtr parse_conditional(); - RefPtr parse_iteration(); + RefPtr parse_for(); + RefPtr parse_while(); RefPtr parse_passthrough(); RefPtr parse_return(); };