Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aliiimaher/compiler
Design a tiny compiler with Lex and Yacc.
https://github.com/aliiimaher/compiler
bison-flex compiler yacc-lex
Last synced: 2 days ago
JSON representation
Design a tiny compiler with Lex and Yacc.
- Host: GitHub
- URL: https://github.com/aliiimaher/compiler
- Owner: aliiimaher
- License: mit
- Created: 2022-11-25T08:22:16.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-08T22:58:53.000Z (about 2 years ago)
- Last Synced: 2024-11-13T20:41:53.696Z (2 months ago)
- Topics: bison-flex, compiler, yacc-lex
- Language: C
- Homepage:
- Size: 1.27 MB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Compiler
Design a tiny compiler with **Lex** and **Yacc**.## About
The project is supposed to read a calculation expression and produce a three-address code in C Language.The project has been divided into three phases.
```mermaid
flowchart TD;
A[Compiler]--Phase 1-->B[Lexical Analysis];
A[Compiler]--Phase 2-->C[Syntax Analysis];
A[Compiler]--Phase 3-->D[Intermediate Code Generation];
```## Running
### Phase 1
```
flex lex.l
gcc lex.yy.c
a.exe
```
### Phase 2
```
bison -d -y yacc.y
gcc y.tab.c
a.exe
```
### Phase 3 (Project)
```
bison -d -y yacc.y
flex lex.l
gcc lex.yy.c y.tab.c
a.exe
```