https://github.com/matteomaso/toycompiler
Simple toy compiler using Flex and Bison
https://github.com/matteomaso/toycompiler
bison compiler flex
Last synced: 3 months ago
JSON representation
Simple toy compiler using Flex and Bison
- Host: GitHub
- URL: https://github.com/matteomaso/toycompiler
- Owner: MatteoMaso
- Created: 2018-04-05T18:31:27.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-14T15:20:34.000Z (over 7 years ago)
- Last Synced: 2025-03-12T23:49:06.663Z (over 1 year ago)
- Topics: bison, compiler, flex
- Language: Yacc
- Homepage:
- Size: 239 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Toy compiler
The purpose of this project is to learn the basics of a compiler by implementing a compiler for a new programming language.
You can find the specific of the programming language into the doc folder.
Also, our compiler is able to convert our code into a C code.
## How it works in an Linux environment:
'go.sh' is a useful script to compile the code for produce the compiler
### Script to produce our compiler
- ./go.sh
### Use our compiler to convert a piece of code in our programming language to a C code
- ./compiler < prog_our_language > prog_c_language.c
### Compile the C code produced with our compiler
- gcc -o our_executable_prog prog_c_language.c
### Execute the produced software
- ./our_executable_prog