diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-03-29 17:48:51 +0100 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-03-29 17:48:51 +0100 |
commit | 68157133549cabe36ca3b6d5d145b85137f55389 (patch) | |
tree | 130ad5651fc0f456ed95cb6be128f7276e0b6ca0 | |
parent | 86b861d6dd4edeb7fe39f8f095ece786c47fdc19 (diff) | |
download | Compiler-68157133549cabe36ca3b6d5d145b85137f55389.tar.gz Compiler-68157133549cabe36ca3b6d5d145b85137f55389.zip |
working on documentation
-rw-r--r-- | 3-compiler-documentation.md | 12 |
1 files changed, 12 insertions, 0 deletions
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
|