]> git.tdb.fi Git - libs/datafile.git/blob - source/statement.cpp
Rewrite the type system
[libs/datafile.git] / source / statement.cpp
1 /* $Id: statement.h 19 2007-08-21 14:11:23Z tdb $
2
3 This file is part of libmspdatafile
4 Copyright © 2007, 2010  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #include <msp/strings/formatter.h>
9 #include "statement.h"
10
11 using namespace std;
12
13 namespace Msp {
14 namespace DataFile {
15
16 Statement::Statement():
17         valid(false),
18         line(0)
19 { }
20
21 Statement::Statement(const string &kw):
22         keyword(kw),
23         valid(true),
24         line(0)
25 { }
26
27 string Statement::get_location() const
28 {
29         string result = source;
30         if(line)
31                 result += format(":%d", line);
32         return result;
33 }
34
35 string Statement::get_signature() const
36 {
37         string result;
38         for(Arguments::const_iterator i = args.begin(); i!=args.end(); ++i)
39                 result += i->get_signature();
40         return result;
41 }
42
43 } // namespace DataFile
44 } // namespace Msp