https://github.com/yujincheng08/llvm-tiger-compiler
Tiny Tiger Compiler
https://github.com/yujincheng08/llvm-tiger-compiler
compiler llvm tiger
Last synced: about 1 year ago
JSON representation
Tiny Tiger Compiler
- Host: GitHub
- URL: https://github.com/yujincheng08/llvm-tiger-compiler
- Owner: yujincheng08
- Created: 2018-05-16T14:58:07.000Z (about 8 years ago)
- Default Branch: llvm
- Last Pushed: 2019-04-12T09:32:26.000Z (about 7 years ago)
- Last Synced: 2025-04-01T01:51:06.443Z (about 1 year ago)
- Topics: compiler, llvm, tiger
- Language: C++
- Size: 2.72 MB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tiny Tiger
Compiler of Tiny Tiger using LLVM.
For language sepeficication please refer to *Morden Compiler Implementation in C*.
## Introduction
Everything is well, including record, array and nested function.
Input or empty string comparision might have some problems to fix. (Therefore merge.tig is not working.)
## Usage
- Compile it with Qt.
- Run it
```shell
./TinyTiger
```
- Input the tiger program, click on compile button. (Run is button not working.)
- On the console, it will output the AST tree and IR code if no syntax or sematic error. And `output.o` is generated.
- Note that if there should not be any generation error output before IR code. If so, report it as a bug with the tiger source code.
- Then link the tiger object file with runtime library.
```shell
clang++ output.o runtime.o
```
PLEASE USE C++ COMPILER (clang++ or g++ or others).
- Run the Tiger program
```
./a.out
```
## Know Issue
- [ ] If syntax error occurs, you must restart the program. Problem might cause by Pipe or the stringstream(not being cleared after error) in yacc code.
- [ ] Merge.tig is not running. Might cause by empty string comparision?
## TODO
- [ ] Output IR code in the bottom widget in the main windows via pipe.
- [ ] Syntax error alert with lineno.
- [ ] Add type to AST visualization.
- [ ] Editor is not good enough.
- [ ] MIGHT automatically generate executive file rather than object file that has to be linked.