#include <vector>
#include "parser.h"
#include "program.h"
-#include "resources.h"
#include "syntax.h"
namespace Msp {
class Compiler
{
private:
- Resources *resources;
Module *module;
std::vector<std::string> imported_names;
Compiler();
~Compiler();
- void compile(const std::string &, const std::string & = "<string>");
- void compile(IO::Base &, Resources * = 0, const std::string & = "<file>");
- void compile(IO::Base &, const std::string &);
+private:
+ void clear();
+public:
+ void set_source(const std::string &, const std::string & = "<string>");
+ void load_source(IO::Base &, DataFile::Collection * = 0, const std::string & = "<file>");
+ void load_source(IO::Base &, const std::string &);
+ void compile();
void add_shaders(Program &);
private:
- void append_module(Module &);
+ void append_module(Module &, DataFile::Collection *);
void append_stage(Stage &);
- void process();
- void import(const std::string &);
+ void import(DataFile::Collection *, const std::string &);
void generate(Stage &);
bool optimize(Stage &);
void finalize(Stage &);
static void inject_block(Block &, const Block &);
- template<typename T>
- static typename T::ResultType apply(Stage &);
- template<typename T, typename A>
- static typename T::ResultType apply(Stage &, const A &);
};
} // namespace SL