Project (practical implementation) of our compulsary course @ Department of Computer Science - University of Karachi in 6th Semester.
(BSCS-504) Compiler Construction - I
. . .
Course Description:
This module introduces topics include compiler design, lexical analysis, parsing, symbol tables, declaration and storage management, code generation, and optimization techniques.
Course Objectives:
The aim of this module is to show how to apply the theory of language translation introduced in the prerequisite courses to build compilers and interpreters. It covers the building of translators both from scratch and using compiler generators. In the process, the module also identifies and explores the main issues of the design of translators. The construction of a compiler/interpreter for a small language is a necessary component of this module, so students can obtain the necessary skill
Course Components:
• Introduction to Compilers • Lexical Analysis • Syntax Analysis (LL1 Grammer) • Parsers Implementation • Semantic Analysis • Error Detection
Practical Implementation:
Design your own Object Oriented Programming Language (can use current programming language), with its language specifications, syntax, and semantics. Then develop lexical analyzer, syntax analyzer and semantic analyzer and report 1st detected error of any phase, on any of your favorite Programming / Scripting Language.
. . .
run main.py file which reads input and writes report in output file and as well as console just replace absolute paths of input and output files.
Directories:
io-files: 1) main.py reads the input.txt file
2) main.py writes report in output.txt file
pdfs: 1) languageSpecifications.pdf contain keywords, regexes etc
2) CFGs.pdf contain all the rules of generally used commands by any programmer
. . .
Note: semantic implementation isn't fully complete or functional right now, will be completed in short time (inshallah)