1 #ifndef TOOL_COMPILER_H_
2 #define TOOL_COMPILER_H_
4 #include <msp/datafile/loader.h>
5 #include <msp/datafile/statement.h>
6 #include <msp/datafile/writer.h>
7 #include <msp/fs/path.h>
9 class Compiler: public Msp::DataFile::Loader
15 Msp::DataFile::Writer &writer;
19 Compiler(Msp::DataFile::Writer &);
21 void file(const std::string &);
22 void for_each(const std::vector<std::string> &);
23 void write(const Msp::DataFile::Statement &);
25 bool process_statement(const Msp::FS::Path &, Msp::DataFile::Statement &);
26 void process_file(const Msp::FS::Path &, const std::list<Msp::DataFile::Statement> &);
27 void process_file(const Msp::FS::Path &);
31 class File: public Msp::DataFile::Loader
35 Msp::FS::Path filename;
36 std::list<Msp::DataFile::Statement> write_st;
39 File(Compiler &, const Msp::FS::Path &);
41 virtual void finish();
43 void write(const Msp::DataFile::Statement &);
47 class ForEach: public Msp::DataFile::Loader
52 std::list<std::string> patterns;
53 std::list<std::string> excludes;
54 std::list<Msp::DataFile::Statement> write_st;
57 ForEach(Compiler &, const Msp::FS::Path &, const std::list<std::string> &);
59 virtual void finish();
61 void exclude(const std::string &);
62 void pattern(const std::string &);
63 void write(const Msp::DataFile::Statement &);