00001 00012 #ifndef _PARSER_H 00013 #define _PARSER_H 00014 00015 #include <fstream> 00016 #include <vector> 00017 00018 // Word(s) container type. 00019 #include "word.h" 00020 00021 namespace ace { 00022 00027 class Parser { 00028 public: 00031 typedef std::vector<size_t> parsed_counter_t; 00032 00033 private: 00036 std::ifstream& _input_file; 00039 size_t _line_no; 00043 parsed_counter_t _parsed_counter; 00044 00045 public: 00046 00050 Parser(std::ifstream& input_file): _input_file(input_file), _line_no(0) {} 00051 00054 inline bool eof(void) const { return _input_file.eof(); } 00055 00058 inline const parsed_counter_t& parsed(void) const { return _parsed_counter; } 00059 00068 bool next(size_t count, ContextWindow::Mode mode, words_store_t& store); 00069 00070 }; 00071 00072 } // namespace ace 00073 00074 #endif
1.5.6