Skip to content

This repository contains the final project for the CS-471L Compiler Construction course at the University of Engineering and Technology (UET), Lahore. Supervised by Mr. Laeeq Khan Niazai, it focuses on Lexical Analysis, Syntax Analysis, Semantic Analysis, Intermediate Code Generation (Three-Address Code), and x86 Assembly Code Generation.

Notifications You must be signed in to change notification settings

Muhammad-Yaqoob-4110/CS-471-Compiler-Construction-C

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Without Using Makefile

To create the object file of lexer

g++ -c ./src/lexer/lexer.cpp

To create the object file of parser

g++ -c ./src/parser/parser.cpp

To create the object file of assembly

g++ -c ./src/assembly/acg.cpp

To create the object file of intermediate code

g++ -c ./src/intermediate/icg.cpp

To create the object file of symbol Table

g++ -c ./src/symboltable/symbTable.cpp

To create the object file of main program

g++ -c ./main.cpp

To, create an exe file, We need to to link all the object files

g++ main.o lexer.o icg.o symbTable.o acg.o parser.o -o main.exe

To run the test the program, we need to provide a file name to our program.

./main.exe program.txt

With Makefile

Crate a dircotry named bin in the root folder and then. Just write the make command, it will compile everything.

make

You will also need to create the target folder in the root direcotry. Because the target generated code is set to this folder. Otherwise, you will not be able to generate assembly and intermediate code file.

About

This repository contains the final project for the CS-471L Compiler Construction course at the University of Engineering and Technology (UET), Lahore. Supervised by Mr. Laeeq Khan Niazai, it focuses on Lexical Analysis, Syntax Analysis, Semantic Analysis, Intermediate Code Generation (Three-Address Code), and x86 Assembly Code Generation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published