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

CC Project Phase 1

This document outlines the requirements for a compiler construction project at the University of Central Punjab involving the implementation of a lexical analyzer (scanner). It describes 5 token types that need to be implemented: identifiers, numbers, operators, punctuations, and keywords. It provides examples for each token type. It specifies that the project has two parts: 1) writing regular expressions and generating finite automata for each token type, due on November 5th, worth 25 marks; and 2) implementing a table-driven scanner, due on November 15th, worth 100 marks. The document notes a late penalty and specifies that only self-developed data structures can be used. It lists criteria for evaluation including generating the proper output files and handling errors.

Uploaded by

alina devs
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)
121 views3 pages

CC Project Phase 1

This document outlines the requirements for a compiler construction project at the University of Central Punjab involving the implementation of a lexical analyzer (scanner). It describes 5 token types that need to be implemented: identifiers, numbers, operators, punctuations, and keywords. It provides examples for each token type. It specifies that the project has two parts: 1) writing regular expressions and generating finite automata for each token type, due on November 5th, worth 25 marks; and 2) implementing a table-driven scanner, due on November 15th, worth 100 marks. The document notes a late penalty and specifies that only self-developed data structures can be used. It lists criteria for evaluation including generating the proper output files and handling errors.

Uploaded by

alina devs
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

University of Central Punjab

Faculty of Information Technology

Compiler Construction
Project (Phase-1) (Section All)
Fall (2021)

UCP-Compiler:

In lexical following token types required to be implemented.

Detail Example
1 Identifiers Start from _ or Letter and contains at least one “_”. Other _rate2, rate_,
rules for ID will remain same. rat_e2 …etc
2 Numbers [ + | - ] ? (D+) (\.D+)?, and exponent numbers. 3.43433E+13,

3 Operators !=, <>, =:= , ==, *, +, /,-, >>,<<, ++, =+, &&, ||, =>, =<,
%, :, :: , --
4 Punctuations [,{,< , >,},]
5 Keyword loop, agar, magar, asm, else, new, this, auto, enum,
operator, throw, bool , explicit, private, true, break,
export, protected , try, case, extern, public, typedef,
catch, false, register, typeid, char, float, typename,
class, for, return, union, const, friend, short, unsigned
goto, signed, using, continue, if, sizeof, virtual, default,
inline, static, void, delete, int, volatile, do, long, struct,
double, mutable, switch, while, namespace
Task Description:
For this assignment, you have to implement a lexical analyzer, also called a scanner. This assignment includes
following parts:

PARTS Output Marks Deadline

1 Write “RE” & generate “FA” for each class described above. Document 25 5 Nov

2 Code - Table Driven Approach Source Code Files 100 15 Nov

Note: (Late will be penalty of deduction of 25% of total marks per day)

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.
4. Application should not do which is not supposed to do.

SCANNER
Sourcecode.txt Token.txt

Error.txt

5. In case of invalid source code tool must generate error list.


GOOD LUCK

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy