Skip to content

Commit 14e6eea

Browse files
committed
Update
1 parent d14fd61 commit 14e6eea

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# blackMAMBO
22
A Tiger compiler, for a **X64 target-machine**, implemented in Standard ML, a "strict, statically typed functional programming language with modular structure".
33

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+
411
# Compiler Phases
512
- [x] **Lex**. Break the source file into individual words, or tokens.
613
- [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
1219
- [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.
1320
- [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).
1421
- [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

Comments
 (0)