You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 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.
0 commit comments