]> git.tdb.fi Git - libs/datafile.git/blob - source/parser.h
Add binary data format
[libs/datafile.git] / source / parser.h
1 /* $Id$
2
3 This file is part of libmspdatafile
4 Copyright © 2006-2007  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_DATAFILE_PARSER_H_
9 #define MSP_DATAFILE_PARSER_H_
10
11 #include <istream>
12 #include <string>
13 #include "input.h"
14
15 namespace Msp {
16 namespace DataFile {
17
18 class ParserMode;
19 class Statement;
20 struct Token;
21
22 class Parser
23 {
24 public:
25         Parser(std::istream &, const std::string &);
26         ~Parser();
27
28         Statement parse();
29         operator bool() const { return in; }
30 private:
31         Input       in;
32         std::string src;
33         bool        good;
34         ParserMode  *mode;
35 };
36
37 } // namespace DataFile
38 } // namespace Msp
39
40 #endif