1 #ifndef MSP_DATAFILE_PARSERMODE_H_
2 #define MSP_DATAFILE_PARSERMODE_H_
4 #include <msp/core/noncopyable.h>
15 Base class for parse modes.
17 class ParserMode: private NonCopyable
21 const std::string &src;
23 ParserMode(Input &i, const std::string &s): in(i), src(s) { }
25 virtual ~ParserMode() = default;
27 virtual Statement parse() = 0;
28 virtual void process_control_statement(const Statement &) { }
30 virtual const StatementKey *peek(unsigned) { return nullptr; }
31 virtual bool parse_and_load(unsigned, Loader &, const LoaderAction &) { return false; }
34 } // namespace DataFile