SHOGUN  v3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Parser.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2013 Evgeniy Andreev (gsomix)
8  */
9 
10 #ifndef __PARSER_H__
11 #define __PARSER_H__
12 
13 #include <shogun/lib/SGVector.h>
14 #include <shogun/lib/Tokenizer.h>
15 
16 namespace shogun
17 {
19 class CParser : public CSGObject
20 {
21 public:
23  CParser();
24 
30  CParser(SGVector<char> string, CTokenizer* tokenizer);
31 
33  virtual ~CParser();
34 
39  virtual bool has_next();
40 
42  virtual void skip_token();
43 
45  virtual SGVector<char> read_string();
46 
48  virtual SGVector<char> read_cstring();
49 
52  virtual bool read_bool();
53  virtual char read_char();
54  virtual uint8_t read_byte();
55  virtual int16_t read_short();
56  virtual uint16_t read_word();
57  virtual int32_t read_int();
58  virtual uint32_t read_uint();
59  virtual int64_t read_long();
60  virtual uint64_t read_ulong();
61  virtual float32_t read_short_real();
62  virtual float64_t read_real();
63  virtual floatmax_t read_long_real();
65 
70  void set_tokenizer(CTokenizer* tokenizer);
71 
76  void set_text(SGVector<char> text);
77 
79  virtual const char* get_name() const { return "Parser"; }
80 
81 private:
83  void init();
84 
85 private:
87  SGVector<char> m_text;
88 
90  CTokenizer* m_tokenizer;
91 };
92 
93 }
94 
95 #endif

SHOGUN Machine Learning Toolbox - Documentation