Compiler Construction: Project (Phase-1) (Section A, B, C, D) Fall (2015)
Compiler Construction: Project (Phase-1) (Section A, B, C, D) Fall (2015)
Project (Phase-1)
Fall (2015)
(Section A, B, C, D)
Reserve words
Identifiers
Numbers
Operators
User
input/output
Note
#DEFINE // define is
keyword
DEFINE
// id
#INCLUDE // include is
keyword
INCLUDE // id
__ cannot be an
identifier.
_ always with some
letter.
Id contain at least one
_.
_ cannot be last symbol
of id.
Must have one or more
digit.
Not start with Digit.
7
8
Punctuations
Comments
[,{,(,),},],,
//this is comment
/*-----*/
Assignment Description:
For this assignment, you have to implement a lexical analyzer, also called a scanner.
This assignment includes following parts:
PARTS
Output
Marks
Document
15
Document
10
Code
Source Code
Files
80
Total
105
Absolute
10
Rules:
1. This is an individual assignment. Each student has to submit his/her
assignment work.
2. Group discussion is allowed but dont share code and other part of
assignment with other student.
3. Plagiarism is not tolerable in any of its form. Minimum penalty would be
ZERO marks in the project module.
Tools:
Language (For Development):
C++
Note: Student cannot use built-in data structure. Student can use his own data
structure Hash Table, Linked List which he/she developed in data structure
course. In this case student has to show me the code before using it.
Evaluating Criteria:
1. Source code should reflect the detail given in documents (other parts).
2. A text file with valid source code will be input of the scanner and Token file
will be output of the scanner tool.
3. All points discussed in the class related to scanner implementation should
reflect in the assignment.
GOOD LUCK