aboutsummaryrefslogtreecommitdiff
path: root/BinaryEncoding.md
diff options
context:
space:
mode:
authortitzer <titzer@google.com>2016-02-09 10:29:35 +0100
committertitzer <titzer@google.com>2016-02-09 10:29:35 +0100
commit01492c6dde963ac7eb6d00d8d5754de98cc2a0c1 (patch)
tree0287da3d6ba2124fa99a6468cce30c86b0e41296 /BinaryEncoding.md
parentfd8db871fc5d2a89b0e6aa2041695f5e6f655d00 (diff)
downloadnanowasm-design-01492c6dde963ac7eb6d00d8d5754de98cc2a0c1.tar.gz
Update definition of pre-order encoding.
Diffstat (limited to 'BinaryEncoding.md')
-rw-r--r--BinaryEncoding.md10
1 files changed, 5 insertions, 5 deletions
diff --git a/BinaryEncoding.md b/BinaryEncoding.md
index 6150c86..e014818 100644
--- a/BinaryEncoding.md
+++ b/BinaryEncoding.md
@@ -58,13 +58,13 @@ Refers to an approach for encoding syntax trees, where each node begins with an
sequence, then followed recursively by any child nodes.
* Examples
- * Given a simple AST node: `struct I32Add { AstNode *left, *right; }`
- * First write the binary sequence for `I32Add` (uint8)
+ * Given a simple AST node: `I32Add(left: AstNode, right: AstNode)`
+ * First write the opcode for `I32Add` (uint8)
* Then recursively write the left and right nodes.
- * Given a call AST node: `struct Call { uint32_t callee_index; vector<AstNode*> args; }`
- * First write the binary sequence of `Call` (uint8)
- * Then write the (variable-length) integer `Call::callee_index` (varuint32)
+ * Given a call AST node: `Call(callee_index: uint32_t, args: AstNode[])`
+ * First write the opcode of `Call` (uint8)
+ * Then write the (variable-length) integer `callee_index` (varuint32)
* Then recursively write each argument node, where arity is determined by looking up `callee_index` in a table of signatures
### Strings