#ifndef _GRAMMAR_H_ #define _GRAMMAR_H_ #include #include #include #include typedef std::map::value_type tSSValue; namespace delphin { class Grammar { public: Grammar(const std::string &); ~Grammar(); class TdlLexer * const lexer() {return _lexer;} std::string &grammarname() {return _gfilename;} std::string grammardir(); void set_letype(std::string le, std::string letype); std::string letype(std::string &le); std::string lexeme(std::string &le); void add_lexrule(std::string rule); bool is_lexrule(std::string rule); void add_letype(std::string letype); bool is_letype(std::string letype); void error(const class location &l, const std::string &m); void error(const std::string &m); private: class TdlLexer *_lexer; std::string _gfilename; boost::filesystem::path _gfile; boost::filesystem::path _gpath; std::map _letypes; std::map _lexemes; std::set _lex_rules; std::set _letype_list; }; } //namespace #endif