]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/statement.cpp
Rewrite the type system
[libs/datafile.git] / source / statement.cpp
index d485a20a80f27f1f082c1cc3e400fdb03c46023a..a1bd688bf38016b24e326ce2e863cc6f76f51fd8 100644 (file)
@@ -1,23 +1,44 @@
 /* $Id: statement.h 19 2007-08-21 14:11:23Z tdb $
 
 This file is part of libmspdatafile
-Copyright © 2006  Mikko Rasa, Mikkosoft Productions
+Copyright © 2007, 2010  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
 #include <msp/strings/formatter.h>
 #include "statement.h"
 
+using namespace std;
+
 namespace Msp {
 namespace DataFile {
 
-std::string Statement::get_location() const
+Statement::Statement():
+       valid(false),
+       line(0)
+{ }
+
+Statement::Statement(const string &kw):
+       keyword(kw),
+       valid(true),
+       line(0)
+{ }
+
+string Statement::get_location() const
 {
-       std::string result = source;
+       string result = source;
        if(line)
                result += format(":%d", line);
        return result;
 }
 
+string Statement::get_signature() const
+{
+       string result;
+       for(Arguments::const_iterator i = args.begin(); i!=args.end(); ++i)
+               result += i->get_signature();
+       return result;
+}
+
 } // namespace DataFile
 } // namespace Msp