X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fprogramparser.h;h=e246251676bdd4b7b453b0c884c55c2da8ae4122;hb=c760a61dd2ffc43c4f72fdfb7aa59949d4e59b06;hp=390f19cbdf921a24ca6c2a6f00adcb76d7c9cce9;hpb=a36992487d018d8801ead6980b362b00a2f5f5c5;p=libs%2Fgl.git diff --git a/source/programparser.h b/source/programparser.h index 390f19cb..e2462516 100644 --- a/source/programparser.h +++ b/source/programparser.h @@ -39,18 +39,21 @@ private: std::string source; std::string::const_iterator iter; std::deque next_tokens; - ProgramSyntax::Module main_module; - ProgramSyntax::Module *cur_module; + ProgramSyntax::Module *module; + ProgramSyntax::Stage *cur_stage; std::set 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(); @@ -81,10 +84,10 @@ private: 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(); };