Design of Compilers - Project
Design of Compilers - Project
(Project)
Dr. Wafaa Samy
Project Details:
The aim of this project is to develop the lexical analysis and syntax analysis phases of the
compiler for the C programming language.
1. Project Team: 5 students.
2. Language Specifications: Identify the basic constructs of the C programming
language such as:
a. Keywords
b. Variable Identifiers
c. Function Identifiers
d. Data Types
e. Functions
f. Statements:
i. Assignment Statement
ii. Declaration Statement
iii. Return Statement
iv. Iterative Statement
v. Conditional Statements
vi. Function Call Statement
g. Expressions
i. Arithmetic
ii. Boolean
3. Use the Java programming language to implement a lexer and a parser for the C
programming language by delivering the following phases:
a. Lexical Analysis (lexer): Categorizes the contents of the input source code
file as tokens based on the C programming language specifications.
b. Syntax Analysis (parser): Creates a Parse Tree for the tokens returned by
the lexer or report if an error is occurred. This phase includes the following
sub-tasks:
i. Adding the Grammar Rules.
ii. Creating the Symbol Table.
iii. Adding the Parse Tree.
4. Final Submission: Implement the lexer and parser as one software application with
Graphical User Interface (GUI) such that:
a. Input: source code file written in the C programming language.
Page 1 of 2
b. Outputs:
i. Tokens.
ii. Symbol Table.
iii. Parse Tree.
iv. Error in case there is a syntax error in the input source code.
5. Write a documentation for your project including the implementation details,
screenshots, and test cases.
6. Provide a short presentation for your project with demo and test cases followed
by discussion for each member in the team individually.
Project Requirements:
1. Language Specifications for the C Programming Language.
2. Create the Lexical Analyzer.
3. Add the Grammar Rules.
4. Create the Symbol Table.
5. Add the Parse Tree.
Due Dates:
Required Task Details Week
1 Project Team Submit the names of students in each team. 3
Submit the language specifications document of the C programming
Language language.
2 4
Specifications Upload the language specifications document to the LMS system.
Creating the Submit the lexical analyzer of the C programming language.
3 Lexical Upload the lexer source code, a demo video with test cases, and the 6
Analyzer lexer documentation to the LMS system.
Submit the syntax analyzer of the C programming language.
Adding the Grammar Rules.
Creating the
Creating the Symbol Table.
4 Syntax 11
Adding the Parse Tree.
Analyzer
Upload the parser source code, a demo video with test cases, and the
parser documentation to the LMS system.
Upload the following to the LMS:
1. Final source code for the implemented lexer and parser.
Final 2. Final documentation about the lexer and parser.
5 13
Submission 3. A video to demonstrate your lexer and parser with test cases.
4. The project presentation.
Provide a short presentation for your project with demo and test cases
6 Discussion followed by discussion for each member in the team individually. 13
Page 2 of 2