├── .gitignore
├── example.txt
├── README.md
├── LICENSE
├── utils.inc
├── linux.inc
├── main.c
└── ds.h
/.gitignore:
--------------------------------------------------------------------------------
1 | main
2 |
--------------------------------------------------------------------------------
/example.txt:
--------------------------------------------------------------------------------
1 | n = input
2 | i = 0
3 | :label
4 | output i
5 | i = i + 1
6 | if i < n then goto :label
7 | if i < 10 then goto :label2
8 | output 69
9 | :label2
10 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Compiler Tutorial in C
2 |
3 | A really simple programming language meant to be used as a tutorial for compilers (really easy ones).
4 |
5 | ```text
6 | term = | variable | literal
7 | expression = term | term + term | ...
8 | rel = term < term | ...
9 | instr = variable = expression | rel instr | :label |