diff options
Diffstat (limited to 'cpp/002main.cc')
-rw-r--r-- | cpp/002main.cc | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/cpp/002main.cc b/cpp/002main.cc index 7aac3d6b..c2baea50 100644 --- a/cpp/002main.cc +++ b/cpp/002main.cc @@ -101,7 +101,10 @@ struct type_info { vector<vector<type_number> > elements; // only if is_record or is_array }; -unordered_map<type_number, type_info> type; +typedef int type_number; +unordered_map<string, type_number> Type_name; +unordered_map<type_number, type_info> Type; +unordered_map<int, int> Memory; struct reagent { string name; @@ -110,15 +113,35 @@ struct reagent { }; struct instruction { - recipe_number op; - vector<reagent> ingredients; - vector<reagent> products; + bool is_label; + string label; // only if is_label + recipe_number operation; // only if !is_label + vector<reagent> ingredients; // only if !is_label + vector<reagent> products; // only if !is_label +}; + +struct recipe { + vector<instruction> step; }; -void load(const char* filename) { +unordered_map<int, recipe> Recipe; + +void load(string filename) { +} + +void run(string function_name) { +} + +void setup_memory() { + Memory.clear(); +} + +void setup_types() { + Type_name["integer"] = 1; + Type[1].size = 1; } -void run(const char* function_name) { +void compile(string form) { } @@ -148,6 +171,8 @@ void verify() { } void setup() { + setup_memory(); + setup_types(); Passed = true; } |