0% found this document useful (0 votes)
125 views3 pages

Assignment 1 - Regular Expression & DFA

This document provides details for Assignment 1 of the Compiler Design and Construction course. The assignment involves implementing a lexical analyzer or scanner for a subset of the SQL language. Students must define regular expressions for all token types, generate a complete deterministic finite automaton, and submit the work before the deadline of October 5, 2019. Late submissions will be penalized. The SQL language features discussed include reserved words, identifiers, literals, operators, and comments.

Uploaded by

Mustafa Shykh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
125 views3 pages

Assignment 1 - Regular Expression & DFA

This document provides details for Assignment 1 of the Compiler Design and Construction course. The assignment involves implementing a lexical analyzer or scanner for a subset of the SQL language. Students must define regular expressions for all token types, generate a complete deterministic finite automaton, and submit the work before the deadline of October 5, 2019. Late submissions will be penalized. The SQL language features discussed include reserved words, identifiers, literals, operators, and comments.

Uploaded by

Mustafa Shykh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

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

You might also like