]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/statement.h
Emit source file markers in compiled files
[libs/datafile.git] / source / statement.h
index 6b3c54b8b7989d386fff3c3cb98ef3354f5433ad..efc097bd7e11b4c100627fbd9dcf8a5776433cc0 100644 (file)
@@ -8,8 +8,6 @@ Distributed under the LGPL
 #define MSP_DATAFILE_STATEMENT_H_
 
 #include <list>
-#include <sstream>
-#include <vector>
 #include "value.h"
 
 namespace Msp {
@@ -26,8 +24,19 @@ public:
        std::list<Statement> sub;
 
        Statement(): valid(false), line(0) { }
-       std::string get_location() const
-       { std::ostringstream ss; ss<<source<<':'<<line; return ss.str(); }
+       Statement(const std::string &kw): keyword(kw), valid(true), line(0) { }
+       std::string get_location() const;
+       
+       template<typename T>
+       Statement &append(const T &v)
+       {
+               args.push_back(Value(v));
+               return *this;
+       }
+
+       template<typename T>
+       Statement &operator,(const T &v)
+       { return append(v); }
 };
 
 } // namespace DataFile