From 68157133549cabe36ca3b6d5d145b85137f55389 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Wed, 29 Mar 2017 17:48:51 +0100 Subject: working on documentation --- 3-compiler-documentation.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/3-compiler-documentation.md b/3-compiler-documentation.md index 2c73bd3..b052904 100644 --- a/3-compiler-documentation.md +++ b/3-compiler-documentation.md @@ -14,12 +14,18 @@ AST Overview Diagram ---------------- +_Add a diagram of your AST, which is designed to *usefully* communicate +the *important* properties of the AST._ + ![my-ast.png](my-ast.png) Description ----------- +_Describe the structure and organisation of your AST in 200 words +or fewer_. + I used a pure abstract Node class as an entry point to the AST. I then had a TranslationUnit class which contained the external declarations and function definitions in a vector. All other classes used linked lists instead of vectors to store @@ -38,6 +44,8 @@ them. Strengths --------- +_Give two strengths or capabilites of your AST, using 50 words or less for each one_. + ### Strength 1 The class hierarchy and structure is very logical as it closely matches the grammar. @@ -72,6 +80,10 @@ Variable binding General approach ---------------- +_Describe your overall approach to mapping variable, parameters, etc. +into registers or memory locations at exection time, using 200 words +or less_. + I did not use many registers because they are a limited resource, and instead I decided only to use registers $2 and $3 for performing operations and rarely use registers $t0 and $t1 when loading the address of a value, for example for pointers. I also used registers $4, $5, $6, $7 -- cgit