#ifndef __cmt_syntax_h__ #define __cmt_syntax_h__ #include "cmt_map.h" #include "cmt_string.h" #include "cmt_system.h" #include "cmt_use.h" class Kwd { public: virtual void action (const CmtSystem::cmt_string_vector& words, Use* use, const cmt_string& file_name, int line_number) = 0; }; class SyntaxParser { public: static SyntaxParser& instance (); static void parse (const CmtSystem::cmt_string_vector& words, Use* use, const cmt_string& file_name, int line_number); static void parse_requirements_line (const cmt_string& line, Use* use, const cmt_string& file_name = "", int line_number = 0); static void parse_requirements_text (const cmt_string& text, const cmt_string& file_name, Use* use); static void parse_requirements (const cmt_string& file_name, Use* use); private: void do_parse (const CmtSystem::cmt_string_vector& words, Use* use, const cmt_string& file_name, int line_number); void do_parse_requirements_line (const cmt_string& line, Use* use, const cmt_string& file_name, int line_number); void do_parse_requirements_text (const cmt_string& text, const cmt_string& file_name, Use* use); void do_parse_requirements (const cmt_string& file_name, Use* use); SyntaxParser (); cmt_map m_keywords; cmt_string m_filtered_text; }; class CommandParser { public: typedef cmt_map HelpMap; typedef cmt_vector HelpTexts; static HelpMap& get_help (); static HelpTexts& get_help_texts (); static const cmt_string& get_help_text (ActionType key); static void show_all (); static void show (ActionType action); private: static CommandParser& instance (); CommandParser (); HelpMap m_help; HelpTexts m_help_texts; }; #endif