X-Git-Url: http://git.tdb.fi/?p=libs%2Fdatafile.git;a=blobdiff_plain;f=source%2Fbinaryparser.h;h=dfb0de995c7092dd60c9ebc19d6d636b408de84b;hp=b10d7b8791916a8e5ce37257c88da1b33603f6bd;hb=HEAD;hpb=e0af585ed57bdb5b1ea4f4a415fda13b5d99d2dc diff --git a/source/binaryparser.h b/source/binaryparser.h index b10d7b8..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,19 +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 = 32; + StatementInfo *cur_info = nullptr; + std::vector sub_remaining; public: BinaryParser(Input &i, const std::string &s); - virtual 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(); IntType::Store parse_int(); FloatType::Store parse_float(); StringType::Store parse_string();