--- /dev/null
+
+#pragma once
+
+#include <compiler/base.hpp>
+#include <ir/module.hpp>
+
+namespace YAMML
+{
+
+namespace IRProcessor
+{
+
+class IRCompiler : public Compiler::CompilerBase
+{
+public:
+ template<typename T>
+ IRCompiler(const IR::Module& ir, T func) : CompilerBase(func), m_IR(ir)
+ {
+ }
+
+ bool Compile();
+
+ const IR::Module& GetIR() const;
+
+private:
+ IR::Module m_IR;
+};
+
+} // namespace IRProcessor
+
+} // namespace YAMML
add_subdirectory(ast2ir)
add_subdirectory(driver)
add_subdirectory(ir2midi)
+add_subdirectory(irprocessor)
add_subdirectory(midiwriter)
add_subdirectory(parser)
endif()
yamml_add_executable(yamml DriverSources DriverHeaders)
-target_link_libraries(yamml AST2IR IR2MIDI MIDIWriter Parser Boost::program_options)
+target_link_libraries(yamml AST2IR IR2MIDI IRProcessor MIDIWriter Parser Boost::program_options)
#include <ast2ir/ast2ir.hpp>
#include <ir2midi/ir2midi.hpp>
+#include <irprocessor/irprocessor.hpp>
#include <midiwriter/midiwriter.hpp>
#include <parser/parser.hpp>
return {};
}
- IR2MIDI::IR2MIDICompiler ir2midi(ast2ir.GetIR().value(), callback);
+ IRProcessor::IRCompiler irProc(ast2ir.GetIR().value(), callback);
+
+ if (!irProc.Compile())
+ {
+ return {};
+ }
+
+ IR2MIDI::IR2MIDICompiler ir2midi(irProc.GetIR(), callback);
if (!ir2midi.Compile(entryPoint))
{
--- /dev/null
+
+set(IRProcessorHeaders
+ ../../include/irprocessor/irprocessor.hpp
+)
+
+set(IRProcessorSources
+ irprocessor.cpp
+)
+
+yamml_add_library(IRProcessor STATIC IRProcessorSources IRProcessorHeaders)
--- /dev/null
+
+#include <irprocessor/irprocessor.hpp>
+
+namespace YAMML
+{
+
+namespace IRProcessor
+{
+
+bool IRCompiler::Compile()
+{
+ return true;
+}
+
+const IR::Module& IRCompiler::GetIR() const
+{
+ return m_IR;
+}
+
+} // namespace IRProcessor
+
+} // namespace YAMML
--- /dev/null
+
+#pragma once
+
+#include <algorithm>
+#include <functional>
+#include <string>
+#include <unordered_map>
+#include <utility>
+#include <vector>
+
+#include <boost/variant.hpp>