Skip to content

Commit db226ec

Browse files
authored
Update README.md
1 parent 5195d86 commit db226ec

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,34 @@
11
# Mini-Python-Compiler
22
This is our Compiler Design project for 6th semester.
3+
4+
## Details
5+
+
6+
+ **Project Title:** Python Compiler (constructs: 'if-else', 'while')
7+
- Using C language till Optimisation of Intermediate Code.
8+
- Using Python Language for Target Code Generation.
9+
+ **Team Members:**
10+
1) Ashish Kumar
11+
2) Anmol yadav
12+
13+
+ **Project Abstract:** The Mini-Compiler, contains all phases of compiler has been made for the language Python by using C language (till intermediate code optimisation phase) and we used Python language itself for target code generation as well . The constructs that have been focused on are ‘if-else’ and ‘while’ statements. The optimizations handled for the intermediate code are ‘packing temporaries’ and ‘constant propagation’. Syntax and semantic errors have been handled and syntax error recovery has been implemented using Panic Mode Recovery in the lexer.
14+
+ **Code Execution: **
15+
1) The following commands can be used to execute the code in any of the folders except '5-Target_Code':
16+
```
17+
lex proj.l
18+
yacc -d -v proj1.y
19+
gcc lex.yy.c y.tab.c -lm -w
20+
a.exe
21+
```
22+
2) The following commands execute the code in the '5-Target_Code' folder:
23+
```
24+
python3 final.py
25+
```
26+
27+
## Various folders
28+
1) **1-Token_And Symbol_Table:** This folder contains the code that outputs the tokens and the symbol table.
29+
2) **2-Abstract_Syntax_Tree:** This folder contains the code that displays the abstract syntax tree.
30+
3) **3-Intermediate_Code_Generation:** This folder contains the code that generates the symbol table before optimisations and the intermediate code.
31+
4) **4-Optimised_ICG:** This folder contains the code that generates the symbol table after optimisations, the quadruples table and the optimised intermediate code.
32+
5) **5-Target_Code:** This folder contains the code that displays the assembly code/target code.
33+
6) **Entire_Compiler:** This folder contains the code that generates the all the above outputs at once and displays it on the terminal.
34+

0 commit comments

Comments
 (0)