You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36-1Lines changed: 36 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,13 @@
1
1
# blackMAMBO
2
2
A Tiger compiler, for a **X64 target-machine**, implemented in Standard ML, a "strict, statically typed functional programming language with modular structure".
3
3
4
+
# About Tiger
5
+
Tiger is a simple language, statically-typed, programming language defined in Andrew W. Appel's book *Modern Compiler Implementation in ML*.
6
+
You can find a fine specification in [Semantic Scholar](https://goo.gl/icf7Np).
7
+
8
+
# Platform
9
+
Linux
10
+
4
11
# Compiler Phases
5
12
-[x]**Lex**. Break the source file into individual words, or tokens.
6
13
-[x]**Parse**. Analyze the phrase structure of the program.
@@ -12,4 +19,32 @@ A Tiger compiler, for a **X64 target-machine**, implemented in Standard ML, a "s
12
19
-[x]**Control Flow Analysis**. Analyze the sequence of instructions into a control flow graph that shows all the possible flows of control the program might follow when it executes.
13
20
-[x]**Liveness Analysis**. Gather info about the flow of info through variables of the the program: calculates the places where each program variable holds a still-needed value (is live).
14
21
-[x]**Register Allocation**. Choose a register to hold each of the variables and temporary values used by the program; variables not live at the same time can share the same register.
15
-
-[x]**Code Emission**. Replace the temporary names in each machine instruction with machine registers.
22
+
-[x]**Code Emission**. Replace the temporary names in each machine instruction with machine registers.
23
+
24
+
# Usage
25
+
First of all:
26
+
27
+
1. Clone repo.
28
+
2. Download and install [Moscow ML](http://mosml.org/). Moscow ML is a "light-weight implementation of Standard ML (SML), a strict functional language used in teaching and research".
29
+
3. Open `Makefile` from blackMAMBO, and update `HOME` path with the path where you installed Moscow ML.
30
+
4. Open a terminal, change directory to blackMAMBO folder, do the following: ```make clean && make depend && make```
31
+
32
+
Now, let's say you want to compile a Tiger program `program.tig`. The simpler way to carry out this operation is doing the following: ```./tiger program.tig```.
33
+
34
+
There exist several options available to display information when compiling a Tiger program using blackMAMBO: ```./tiger -option program.tig```, where `option` can be
35
+
36
+
*`ir`: displays IR-tree.
37
+
*`canon`: displays canon code.
38
+
*`liveout`: displays live-out info in an instruction-graph way.
39
+
*`assembly`: displays program assembly.
40
+
41
+
# Bibliography
42
+
*Modern Compiler Implementation in ML*, Andrew W. Appel.
43
+
44
+
# More Info
45
+
**Compilers* final class project. Computer Science. National University of Rosario.
46
+
* Some code comments are written in Spanish, although the majority of them are written in English. Sorry about that.
47
+
48
+
> Yes! I did it! :metal:
49
+
50
+
*Project presented on December 6, 2017. National University of Rosario*
0 commit comments