29 lines
671 B
C++
29 lines
671 B
C++
|
#include "Compiler.h"
|
||
|
#include "Parser.h"
|
||
|
#include "Environment.h"
|
||
|
|
||
|
namespace NVL::Compiler {
|
||
|
struct _DirectedGraphNode {
|
||
|
Vector<_DirectedGraphNode*> reached_by;
|
||
|
|
||
|
Vector<std::pair<i32, Vector<Environment::Variable>>> sequence;
|
||
|
};
|
||
|
void Compile(Vector<Parse::Scene>& scenes, i32 entry_scene_index) {
|
||
|
_DirectedGraphNode n{};
|
||
|
Vector<Environment::Variable> procs_used{};
|
||
|
|
||
|
for (auto& c : scenes[entry_scene_index].get()) {
|
||
|
Environment::Variable f = Environment::Eval(c[0]);
|
||
|
Vector<Environment::Variable> s{};
|
||
|
u32 i = 1;
|
||
|
while (i < c.size()) {
|
||
|
s.push_back(Environment::Eval(c[i++]));
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|
||
|
void Serialize(_DirectedGraphNode root) {
|
||
|
|
||
|
}
|
||
|
}
|