From e05847550c276debb831eb4853474b0da38614ef Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 14 Apr 2015 17:46:43 -0700 Subject: 1061 --- cpp/.traces/get_default_space | 14 ++++++++++++++ cpp/027space | 14 ++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 cpp/.traces/get_default_space diff --git a/cpp/.traces/get_default_space b/cpp/.traces/get_default_space new file mode 100644 index 00000000..1d521c90 --- /dev/null +++ b/cpp/.traces/get_default_space @@ -0,0 +1,14 @@ +parse/0: instruction: 1 +parse/0: ingredient: {name: "10", value: 0, type: 0, properties: ["10": "literal"]} +parse/0: product: {name: "default-space", value: 0, type: 2-0, properties: ["default-space": "address":"space"]} +parse/0: instruction: 1 +parse/0: ingredient: {name: "default-space", value: 0, type: 2-0, properties: ["default-space": "address":"space"]} +parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer", "raw": ]} +after-brace/0: recipe main +after-brace/0: copy ... +after-brace/0: copy ... +run/0: instruction main/0 +run/0: ingredient 0 is 10 +run/0: instruction main/1 +run/0: ingredient 0 is default-space +mem/0: storing 10 in location 1 diff --git a/cpp/027space b/cpp/027space index 7794db23..9d3ef572 100644 --- a/cpp/027space +++ b/cpp/027space @@ -71,3 +71,17 @@ int address(int offset, int base) { //? cout << "AAA " << Current_routine.calls.top().default_space << '\n'; //? 1 return; } + +:(scenario "get_default_space") +recipe main [ + default-space:address:space <- copy 10:literal + 1:integer/raw <- copy default-space:address:space +] ++mem: storing 10 in location 1 + +:(after "vector read_memory(reagent x)") + if (x.name == "default-space") { + vector result; + result.push_back(Current_routine.calls.top().default_space); + return result; + } -- cgit 1.4.1-2-gfad0