https://github.com/rayniel95/cool-interpreter
COOL interpreter with type inference functionality. I used a mixture of top-bottom and bottom-up approach.
https://github.com/rayniel95/cool-interpreter
cool cool-language inference-functionality interpreter lexer-parser python python-3 university-coursework university-of-havana university-project
Last synced: about 2 months ago
JSON representation
COOL interpreter with type inference functionality. I used a mixture of top-bottom and bottom-up approach.
- Host: GitHub
- URL: https://github.com/rayniel95/cool-interpreter
- Owner: rayniel95
- Created: 2021-01-22T20:15:00.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-09-18T18:13:16.000Z (over 4 years ago)
- Last Synced: 2025-03-06T18:50:16.370Z (about 1 year ago)
- Topics: cool, cool-language, inference-functionality, interpreter, lexer-parser, python, python-3, university-coursework, university-of-havana, university-project
- Language: Python
- Homepage:
- Size: 388 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# About
The idea of this project is to create a [COOL](https://en.wikipedia.org/wiki/Cool_(programming_language)) interpreter with type inference functionality. COOL is a strong, statically typed programming language, in this project I extend the built in types adding an AUTO_TYPE, this type inform to the interpreter that it is necessary to make a type inference for this. This mean that the AUTO_TYPE is turned into other type before code execution.
## See more
See:
- orden.pdf.
# How to execute
The test cases ending with `- copia.cl` use AUTO_TYPE. The test cases without `- copia.cl` do not use AUTO_TYPE.
Build image: `docker build ./ -t rayniel95/cool-interpreter:v1.0`
Execute: `docker run --rm --mount type=bind,source="absolute/path/to/repository",destination="/usr/src/app" -it rayniel95/cool-interpreter:v1.0 python main.py "./test_cases/.cl"`
# Requirements
Docker
**Note:** this interpreter can be improved, example --> take a look to if/else block.