#define MSP_DATAFILE_BINARYPARSER_H_
#include <map>
-#include "binarydict.h"
#include "parsermode.h"
#include "type.h"
class BinaryParser: public ParserMode
{
private:
- typedef std::map<int, DictEntry> Dictionary;
+ typedef std::map<int, StatementInfo> Dictionary;
typedef std::map<unsigned, std::string> StringMap;
Dictionary dict;
StringMap strings;
- bool first;
- unsigned float_precision;
+ unsigned float_precision = 32;
+ StatementInfo *cur_info = nullptr;
+ std::vector<unsigned> 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();