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

CCProject Phase One

This document provides details for a compiler construction project assignment to implement a lexical analyzer or scanner. The assignment has two parts: 1) Developing a regular expression and finite state automata including a transition table for tokenization. 2) Implementing a table driven scanner in C++ that takes a source code file as input and outputs tokenized tokens to a file, as well as any errors. The document lists 5 token types to support along with example identifiers, numbers, operators, punctuations and keywords. It provides guidelines on using self-developed data structures in C++ and evaluation criteria focusing on code quality and expected functionality of the scanner tool.

Uploaded by

triaz7191
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)
96 views3 pages

CCProject Phase One

This document provides details for a compiler construction project assignment to implement a lexical analyzer or scanner. The assignment has two parts: 1) Developing a regular expression and finite state automata including a transition table for tokenization. 2) Implementing a table driven scanner in C++ that takes a source code file as input and outputs tokenized tokens to a file, as well as any errors. The document lists 5 token types to support along with example identifiers, numbers, operators, punctuations and keywords. It provides guidelines on using self-developed data structures in C++ and evaluation criteria focusing on code quality and expected functionality of the scanner tool.

Uploaded by

triaz7191
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 (2023)

Submission Before: 6:00PM - 13-11-2023

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. rat1e2 …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, for, do,
round, iif
Assignment Description:
For this assignment, you have to implement a lexical analyzer, also called a scanner. This assignment includes
following parts:

PARTS Output Marks Deadline

Regular expression + Finite Automata (DFA) + Transition


1 Document 25 6 Nov
Table

2 Code - Table Driven Approach Source Code Files 100 13 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