]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/binaryparser.h
Cosmetic changes
[libs/datafile.git] / source / binaryparser.h
index 26fa380e4e290b67c4172449a009cc47991b5efc..f6226a1d621df86719b45b653a41fc883ba8194f 100644 (file)
@@ -1,16 +1,9 @@
-/* $Id$
-
-This file is part of libmspdatafile
-Copyright © 2007  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef MSP_DATAFILE_BINARYPARSER_H_
 #define MSP_DATAFILE_BINARYPARSER_H_
 
 #include <map>
-#include "binarydict.h"
 #include "parsermode.h"
+#include "type.h"
 
 namespace Msp {
 namespace DataFile {
@@ -21,24 +14,30 @@ Parses data in binary format.
 class BinaryParser: public ParserMode
 {
 private:
-       typedef std::map<unsigned, DictEntry> Dictionary;
+       typedef std::map<int, StatementInfo> Dictionary;
        typedef std::map<unsigned, std::string> StringMap;
 
        Dictionary dict;
        StringMap strings;
-       bool first;
+       unsigned float_precision = 32;
+       StatementInfo *cur_info = nullptr;
+       std::vector<unsigned> sub_remaining;
 
 public:
        BinaryParser(Input &i, const std::string &s);
-       Statement parse();
+
+       Statement parse() override;
+       void process_control_statement(const Statement &) override;
+
+       const StatementKey *peek(unsigned) override;
+       bool parse_and_load(unsigned, Loader &, const LoaderAction &) override;
+
 private:
-       Statement parse_statement();
-       long long parse_int();
-       float parse_float();
-       std::string parse_string();
-       bool parse_bool();
-       std::string parse_enum();
-       const std::string &lookup_string(unsigned) const;
+       IntType::Store parse_int();
+       FloatType::Store parse_float();
+       StringType::Store parse_string();
+       BoolType::Store parse_bool();
+       SymbolType::Store parse_symbol();
 };
 
 } // namespace DataFile