]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/parsermode.h
Cosmetic changes
[libs/datafile.git] / source / parsermode.h
index ae407566a9d0442a96a699cbfde1b1387c1add91..319b0f1ae0bf5162bd08e0101f894bf48ab53375 100644 (file)
@@ -1,34 +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 <msp/core/noncopyable.h>
 #include "statement.h"
 
 namespace Msp {
 namespace DataFile {
 
 class Input;
+class Loader;
+class LoaderAction;
 
 /**
 Base class for parse modes.
 */
-class ParserMode
+class ParserMode: private NonCopyable
 {
 protected:
        Input &in;
-       std::string src;
+       const std::string &src;
 
        ParserMode(Input &i, const std::string &s): in(i), src(s) { }
 public:
-       virtual ~ParserMode() { }
+       virtual ~ParserMode() = default;
+
+       virtual Statement parse() = 0;
+       virtual void process_control_statement(const Statement &) { }
 
-       virtual Statement parse() =0;
+       virtual const StatementKey *peek(unsigned) { return nullptr; }
+       virtual bool parse_and_load(unsigned, Loader &, const LoaderAction &) { return false; }
 };
 
 } // namespace DataFile