X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbinaryparser.h;h=f6226a1d621df86719b45b653a41fc883ba8194f;hb=d8bda96a0aac09774bb1e2a8b57ac2e48a93b3c1;hp=e6735f2435a71c447450ecd58aacbf46342859be;hpb=6653c7d83dbe1fe81a541a125be8bb808b234eb7;p=libs%2Fdatafile.git diff --git a/source/binaryparser.h b/source/binaryparser.h index e6735f2..f6226a1 100644 --- a/source/binaryparser.h +++ b/source/binaryparser.h @@ -2,7 +2,6 @@ #define MSP_DATAFILE_BINARYPARSER_H_ #include -#include "binarydict.h" #include "parsermode.h" #include "type.h" @@ -15,20 +14,25 @@ Parses data in binary format. class BinaryParser: public ParserMode { private: - typedef std::map Dictionary; + typedef std::map Dictionary; typedef std::map StringMap; Dictionary dict; StringMap strings; - bool first; - unsigned float_precision; + unsigned float_precision = 32; + StatementInfo *cur_info = nullptr; + std::vector sub_remaining; public: BinaryParser(Input &i, const std::string &s); - virtual Statement parse(bool); + 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(bool); IntType::Store parse_int(); FloatType::Store parse_float(); StringType::Store parse_string();