blob: 54ab5767109cfb5f986c4be6436cee02801d0df3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
# CUP Compiler in CUP
This is an implementation of the CUP compiler in itself! As of this writing, it can generate identical assembly code to the compiler written in C.
```bash
$ make
gcc -Wall -Wextra -Werror -ggdb3 -o build/cupcc <...>
$ ./build/cupcc compiler/main.cup -o 1.nasm
$ make 1.out
nasm -felf64 1.nasm -o 1.o
ld 1.o -o 1.out
$ ./1.out compiler/main.cup -o 2.nasm
$ diff 1.nasm 2.nasm
$ # no output, same generated code, yay!
```
|