COMSATS-Lancaster Dual Degree Programme
Lancaster Block, CIIT, Defence Road, Off Raiwind Road, Lahore
Compiler Design and Construction
Assignment - 1 / Project (Phase-1) (Section A, B, C, D)
Fall (2019)
Submission Before: 6:00PM – 05-10-2019
(Late will be penalty of deduction of 2 absolute marks per day)
MiniC Compiler:
This is a subset of SQL language. For detailed assistance you can use Language manual on following link
https://docs.oracle.com/cd/E11882_01/server.112/e41084/toc.htm and https://www.w3resource.com/sql/sql-
syntax.php.
Description of the language as follow:
# Lexeme Types Detail Notes
1 Reserve words CHAR, VARCHAR, FLOAT, LONG,
DATE, BLOB, INT, NUMBER, SELECT,
DELETE, UPDATE, WHERE, LIKE
2 Identifiers Any number, character, and the
underscore (_), pound (#), and dollar
($) symbols
The first character must be A Letter
Identifier cannot contain Spaces,
double-quotes ("), or special
characters
3 Numeric, Examples of text literals
character and 'Hello'
string literals
'ORACLE.dbs'
'Jackie''s raincoat'
'09-MAR-98'
N'nchar literal'
Numeric literal
25
+6.34
0.5
25e-03
-1
Floating point Literal
25f
+6.34F
0.5d
-1D
Boolean And Date literal
TRUE and 'JAN-28-1976 21:12:40:00'
4 Operators *, + , /, -, ||, <,<>,<=,>
5 Punctuations ;
7 Comments -- for single line comment
/* */ for multi line 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
Define Lexical Specification (Regular Expressions) for all
1 Document 10
token types.
2 Generate complete DFA Document 10
Total 20
Rules:
1. This is an individual assignment. Each student has to submit his/her assignment work.
2. Group discussion is allowed but don’t 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
Assignment/Project module.
Tools:
Software (For Design): MS – WORD or Microsoft Visio or Hand written