From 65361948ca7975553757a0e0df4ac7352413044c Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 14 May 2015 16:04:45 -0700 Subject: 1376 - update github docs --- html/031address.cc.html | 62 ++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'html/031address.cc.html') diff --git a/html/031address.cc.html b/html/031address.cc.html index e67afc4c..e54f6df1 100644 --- a/html/031address.cc.html +++ b/html/031address.cc.html @@ -2,7 +2,7 @@ -Mu - 031address.cc +~/Desktop/s/mu/031address.cc @@ -14,12 +14,12 @@ pre { white-space: pre-wrap; font-family: monospace; color: #d0d0d0; background- body { font-family: monospace; color: #d0d0d0; background-color: #000000; } * { font-size: 1em; } .CommentedCode { color: #6c6c6c; } -.SalientComment { color: #00ffff; } .Constant { color: #008080; } .Comment { color: #8080ff; } .Delimiter { color: #c000c0; } .Special { color: #ff6060; } .Identifier { color: #008080; } +.SalientComment { color: #00ffff; } .traceContains { color: #008000; } --> @@ -37,31 +37,31 @@ body { font-family: monospace; color: #d0d0d0; background-color: #000000; } :(scenario copy_indirect) recipe main [ - 1:address:integer <- copy 2:literal - 2:integer <- copy 34:literal + 1:address:number <- copy 2:literal + 2:number <- copy 34:literal # This loads location 1 as an address and looks up *that* location. - 3:integer <- copy 1:address:integer/deref + 3:number <- copy 1:address:number/deref ] +run: instruction main/2 +mem: location 1 is 2 +mem: location 2 is 34 +mem: storing 34 in location 3 -:(before "index_t base = x.value" following "vector<long long int> read_memory(reagent x)") +:(before "index_t base = x.value" following "vector<double> read_memory(reagent x)") x = canonize(x); //: similarly, write to addresses pointing at other locations using the //: 'deref' property :(scenario store_indirect) recipe main [ - 1:address:integer <- copy 2:literal - 1:address:integer/deref <- copy 34:literal + 1:address:number <- copy 2:literal + 1:address:number/deref <- copy 34:literal ] +run: instruction main/1 +mem: location 1 is 2 +mem: storing 34 in location 2 -:(before "index_t base = x.value" following "void write_memory(reagent x, vector<long long int> data)") +:(before "index_t base = x.value" following "void write_memory(reagent x, vector<double> data)") x = canonize(x); :(code) @@ -79,7 +79,7 @@ reagent deref(reagent x)< //? cout << "deref: " << x.to_string() << "\n"; //? 2 static const type_number ADDRESS = Type_number["address"]; reagent result; - assert(x.types[0] == ADDRESS); + assert(x.types.at(0) == ADDRESS); // compute value result.set_value(Memory[x.value]); @@ -92,12 +92,12 @@ reagent deref(reagent x)< index_t i = 0; size_t len = x.properties.size(); for (i = 0; i < len; ++i) { - if (x.properties[i].first == "deref") break; - result.properties.push_back(x.properties[i]); + if (x.properties.at(i).first == "deref") break; + result.properties.push_back(x.properties.at(i)); } ++i; // skip first deref for (; i < len; ++i) { - result.properties.push_back(x.properties[i]); + result.properties.push_back(x.properties.at(i)); } return result; } @@ -105,26 +105,26 @@ reagent deref(reagent x)< //:: 'get' can read from container address :(scenario get_indirect) recipe main [ - 1:integer <- copy 2:literal - 2:integer <- copy 34:literal - 3:integer <- copy 35:literal - 4:integer <- get 1:address:point/deref, 0:offset + 1:number <- copy 2:literal + 2:number <- copy 34:literal + 3:number <- copy 35:literal + 4:number <- get 1:address:point/deref, 0:offset ] +run: instruction main/3 +run: address to copy is 2 -+run: product 0 is 34 ++run: product 0 is 4 +mem: storing 34 in location 4 :(scenario include_nonderef_properties) recipe main [ - 1:integer <- copy 2:literal - 2:integer <- copy 34:literal - 3:integer <- copy 35:literal - 4:integer <- get 1:address:point/deref/foo, 0:offset + 1:number <- copy 2:literal + 2:number <- copy 34:literal + 3:number <- copy 35:literal + 4:number <- get 1:address:point/deref/foo, 0:offset ] +run: instruction main/3 +run: address to copy is 2 -+run: product 0 is 34 ++run: product 0 is 4 +mem: storing 34 in location 4 :(after "reagent base = " following "case GET:") @@ -133,14 +133,14 @@ base = canonize(base);:(scenario get_address_indirect) # 'get' can read from container address recipe main [ - 1:integer <- copy 2:literal - 2:integer <- copy 34:literal - 3:integer <- copy 35:literal - 4:integer <- get-address 1:address:point/deref, 0:offset + 1:number <- copy 2:literal + 2:number <- copy 34:literal + 3:number <- copy 35:literal + 4:number <- get-address 1:address:point/deref, 0:offset ] +run: instruction main/3 +run: address to copy is 2 -+run: product 0 is 2 ++run: product 0 is 4 :(after "reagent base = " following "case GET_ADDRESS:") base = canonize(base); @@ -150,15 +150,15 @@ base = canonize(base);:(code) bool has_property(reagent x, string name) { for (index_t i = 0; i < x.properties.size(); ++i) { - if (x.properties[i].first == name) return true; + if (x.properties.at(i).first == name) return true; } return false; } vector<string> property(const reagent& r, const string& name) { for (index_t p = 0; p != r.properties.size(); ++p) { - if (r.properties[p].first == name) - return r.properties[p].second; + if (r.properties.at(p).first == name) + return r.properties.at(p).second; } return vector<string>(); } -- cgit 1.4.1-2-gfad0