Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/forsaken1/simple-compiler
Remembering my university course "Programming Languages and Translation Methods"
https://github.com/forsaken1/simple-compiler
compiler learning
Last synced: about 1 month ago
JSON representation
Remembering my university course "Programming Languages and Translation Methods"
- Host: GitHub
- URL: https://github.com/forsaken1/simple-compiler
- Owner: forsaken1
- Created: 2016-01-19T10:42:04.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-13T06:06:16.000Z (almost 9 years ago)
- Last Synced: 2024-10-25T02:02:42.559Z (3 months ago)
- Topics: compiler, learning
- Language: Crystal
- Homepage:
- Size: 98.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple Compiler
Rewrite my old compiler https://github.com/forsaken1/compiler
Grammar: C lang (cutted), based on https://www.lysator.liu.se/c/ANSI-C-grammar-y.html
Status: syntax analysis
## Todo
1. [x] lexical analysis
2. [ ] syntax analysis
3. [ ] semantic analysis
4. [ ] code generation
5. [ ] optimization
6. [ ] code-not-shitication
## Installation
```bash
brew install crystal-lang
git clone [email protected]:forsaken1/simple-compiler.git
cd simple-compilercrystal build simple-compiler.cr # build compiler
./simple-compiler path/to/file.txt # compile file without optimization
./simple-compiler -s path/to/file.txt # returns list of tokens (scanner)
./simple-compiler -p path/to/file.txt # returns syntax tree (parser)
./simple-compiler -g path/to/file.txt # returns assembler code (generator)
./simple-compiler -o path/to/file.txt # compile file with optimization
./simple-compiler -g -o path/to/file.txt # returns assembler code with optimizationcrystal tester.cr # run all tests (don't work without simple-compiler)
```