0% found this document useful (0 votes)
135 views

CC Project Report

This document is a project report for developing a compiler. It outlines the group members, table of contents, and begins describing the project by defining tokens for the language. It lists 10 token types including keywords, operators, identifiers, and integer literals. It also discusses regular expressions, Thompson construction, subset construction, grammar, LR(0) automation, parsing table, sample inputs, stacks and parse trees for parsing the language. The document is incomplete as content is missing for many of the sections listed in the table of contents.

Uploaded by

karrar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
135 views

CC Project Report

This document is a project report for developing a compiler. It outlines the group members, table of contents, and begins describing the project by defining tokens for the language. It lists 10 token types including keywords, operators, identifiers, and integer literals. It also discusses regular expressions, Thompson construction, subset construction, grammar, LR(0) automation, parsing table, sample inputs, stacks and parse trees for parsing the language. The document is incomplete as content is missing for many of the sections listed in the table of contents.

Uploaded by

karrar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Page 1 of 6

DHA Suffa University


CS-313–Compiler Construction
Project Report

Group Members:
1. Muhammad Karrar [Leader] (CS151055)
2. Nauman Khan (CS142004)
3. Asad Ali (CS151135)
4. Maaz Hussain (CS142026)
5. Muhammad Hamza Mian (CS151146)

Instructor: Ms. Raazia Soosan


Date of Submission: 4-December-2017
Page 2 of 6

DHA SUFFA UNIVERSITY


COMPILER CONSTRUCTION
FALL 2017
INSTRUCTOR: RAAZIA SOSAN

Table of Contents
1. PROJECT DESCRIPTION:......................................................................................................................... 3
Compilation Process: ................................................................................. Error! Bookmark not defined.
Sample of Compilation Process: ............................................................ Error! Bookmark not defined.
Language Description:................................................................................ Error! Bookmark not defined.
2. TOKENS: ................................................................................................................................................ 3
3. REGULAR EXPRESSION: ......................................................................................................................... 4
4. THOMPSON CONSTRUCTION: ............................................................................................................... 4
5. SUBSET CONSTRUCTION ....................................................................................................................... 5
6. GRAMMAR ............................................................................................................................................ 5
7. LL(1) AUTOMATION: ............................................................................................................................. 5
8. PARSING TABLE ..................................................................................................................................... 5
9. SAMPLE INPUT 1 .................................................................................................................................. 5
10. STACK FOR INPUT 1 ........................................................................................................................... 5
11. PARSE TREE FOR INPUT 1 .................................................................................................................. 5
12. SAMPLE INPUT 2 ............................................................................................................................... 6
13. STACK FOR INPUT 2 ........................................................................................................................... 6
14. PARSE TREE FOR INPUT 2 .................................................................................................................. 6
15. SAMPLE INPUT 3 ............................................................................................................................... 6
16. STACK FOR INPUT 3 ........................................................................................................................... 6
17. PARSE TREE FOR INPUT 3 ................................................................................................................. 6
18. SOURCE CODE: .................................................................................................................................. 6
i) compilerProject.y ............................................................................... Error! Bookmark not defined.
ii) compilerProject.l ................................................................................ Error! Bookmark not defined.
iii) compilerProject.h............................................................................... Error! Bookmark not defined.
iv) compilerProject.txt ............................................................................ Error! Bookmark not defined.
Page 3 of 6

1. PROJECT DESCRIPTION:

2. TOKENS:
To implement such a language, we would be creating the following tokens:
1. START
2. DECLARE
3. VARIABLE
4. PRINT
5. TERMINATE
6. * (MULT)
7. + (ADD)
8. = (ASIG)
9. INTEGER
10. NEWLINE
Page 4 of 6

3. REGULAR EXPRESSION:
i) {keywords}
ii) {operators}
iii) {identifier}
iv) ";"$
v) ^[0-9]+$
vi) [0-9]+"."[0-9]+("e"|"E")("+"|"-")?[0-9]+$
vii) '(.*)'
viii) \"(.*)\"
ix) "//"(.*)
x) "/*"(.*)"*/"

4. THOMPSON CONSTRUCTION:
i)
ii)
iii)
Page 5 of 6

5. SUBSET CONSTRUCTION
i)
ii)
iii)

6. GRAMMAR

7. LR(0) AUTOMATION:

8. PARSING TABLE

9. SAMPLE INPUT 1

10. STACK FOR INPUT 1

11. PARSE TREE FOR INPUT 1


Page 6 of 6

12. SAMPLE INPUT 2

13. STACK FOR INPUT 2

14. PARSE TREE FOR INPUT 2

15. SAMPLE INPUT 3

16. STACK FOR INPUT 3

17. PARSE TREE FOR INPUT 3

18. SOURCE CODE

You might also like