X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fparsermode.h;h=5c9deceb7d2c289b224c7b5a20ed8dc9cf69131d;hb=e1b8089be727f651fc2022d6e7ff775047730e85;hp=824525d66aeeddaa0347e1848b18f409d8e82f91;hpb=27630d44298cb67e075c166f4421288cc8ca117e;p=libs%2Fdatafile.git diff --git a/source/parsermode.h b/source/parsermode.h index 824525d..5c9dece 100644 --- a/source/parsermode.h +++ b/source/parsermode.h @@ -1,31 +1,34 @@ -/* $Id$ - -This file is part of libmspdatafile -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_DATAFILE_PARSERMODE_H_ #define MSP_DATAFILE_PARSERMODE_H_ +#include #include "statement.h" namespace Msp { namespace DataFile { class Input; +class Loader; +class LoaderAction; -class ParserMode +/** +Base class for parse modes. +*/ +class ParserMode: private NonCopyable { protected: Input ∈ - std::string src; + const std::string &src; ParserMode(Input &i, const std::string &s): in(i), src(s) { } public: virtual ~ParserMode() { } - virtual Statement parse() =0; + virtual Statement parse() = 0; + virtual void process_control_statement(const Statement &) { } + + virtual const StatementKey *peek(unsigned) { return 0; } + virtual bool parse_and_load(unsigned, Loader &, const LoaderAction &) { return false; } }; } // namespace DataFile