SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
LAB REPORT
Regular Expression
Course Code: CSE 331
Course Title: Compiler Design
Submitted By
Umme Habiba
Id:142-15-3677
Section -B
Submitted To
Mr. Seraj Al Mahmud Mostafa
Senior Lecturer
Dept. Of Computer Science and Engineering
Daffodil International University
Submission Date: 17/04/2017
Problem Statement:
In this lab task, we will work on regular expressions. For simplicity, we will assume that there is a
fixed set of regular expressions. We will not consider out of these. But we must not use any built-in
method or package in our implementation .The selected Regular Expressions are:
1. a(bc)*de
2. a(bc)+de
3. a(bc)?de
4. [a-m]*
5. [^aeiou]
6. [^aeiou]{6}
Here,
'*' means occurrence of zero of more characters,
'+' indicates happening of one or more characters,
'?' means only once or not at all occurrence,
'[ ]' indicates happening of inclusive characters,
'^' indicates that next characters will not be used in the pattern,
'[a-d]{3}' indicates that valid string will be exactly of length 3 inclusively using a, b, c, d.
The program has to show “Accepted” if a given string is supported by a RE, otherwise, it will
show “Not Accepted”.
Input & Output Format:
Here we work with a fixed set of regular expressions and will not consider out of these. Per RE will
generate an individual answer and the given format is like that….
When we run our program, command prompt tells how many string we want to input and after
input the 1st string it shows the individual output of the RE. The Input-Output format of our
program is like…
Variable Description:
In our whole program we use some variables.The most important variables that used in our
program are string,flag,flag2,flag3,I and n.
String:This variable is a character array type variable that is used to store the string that user is
given.
Flag: This is a integer type variable. It helps our program to give output easier and accts as a
status.
Others: Here we also use some integer type variable and they helps for looping and keeping
number. These are i,n.
Algorithm Description:
Algorithm that is used In our program to solve the problem more easier is given below:
Algorithm:
1. Number input
2. For: Take input till number
3. String  input
4. For : Take string till null character
5. Check if the characters exists
6. If: exists
7. Print : Accepted
8. Else:
9. Print : Not Accepted
10. Return.
The program starts with taking the string as input. Then, the program calls 6 function
individually. The functions are:
1. zero_or_more(string)
2. one_or_more(string)
3. once_or_notAtAll(string)
4. character_class(string)
5. negationOf_character_class(string)
6.exactly_N_times(string)
These all functions catch the input string parameters. Each function works with their own
algorithm according to the problem domain to justify the input string is valid or not.
Structure Diagram:
Here we show a structure diagram as well as flow chart of our project is:
Start
Input a number,n
(i=0)
i
Call the functions
yesNot Accepted
Satisfy
RE??
Input a string
i<n
End
i++
yesno
i++
CorrectnessArguments:
As my algorithm works 100% properly to solve the RE problem and showing the expected
output format result for the requirement, I honestly and truly can claim about it.There are some
reasons why I claim about it-
1.Here in testing description section, I shall show the proof of my work that it
can show output properly.
2.It shows the exact output what is wanted to show.
3.As I didn’t find any bug.
TestDescription:
A few Testing Screenshots of command prompt is shown in below:
Known Bugs:
I didn’t find any kind of bugs in my program.
Comment:
In the compiler, the most important topic is RE and I am happy for completing my final lab
project according with this topic.I enjoy my code as some portion make me thoughtful.
Contribution:
As I complete the given project myself, there is no contribution of any partner.

More Related Content

PPTX
Lock based protocols
PPTX
Matching techniques
PPTX
Issues in knowledge representation
PPTX
PageRank Algorithm In data mining
PPTX
Semantic net in AI
PPTX
1.10. pumping lemma for regular sets
PPTX
Minmax Algorithm In Artificial Intelligence slides
PPTX
Boyer moore algorithm
Lock based protocols
Matching techniques
Issues in knowledge representation
PageRank Algorithm In data mining
Semantic net in AI
1.10. pumping lemma for regular sets
Minmax Algorithm In Artificial Intelligence slides
Boyer moore algorithm

What's hot (20)

PPTX
Ai 8 puzzle problem
PPTX
Timestamp protocols
PPTX
Remote Procedure Call in Distributed System
PPT
17. Recovery System in DBMS
PPTX
Instruction level parallelism
PDF
Ch 7 Knowledge Representation.pdf
DOCX
Software Engineering Assignment
PDF
Artificial Intelligence Notes Unit 2
PPTX
Top down parsering and bottom up parsering.pptx
PPTX
Online Job Portal ppt presentation
PPTX
Code generation
PDF
Production System in AI
PPTX
RECURSIVE DESCENT PARSING
PPT
Chaps 1-3-ai-prolog
PPTX
Knowledge Representation, Inference and Reasoning
PPTX
Fragmentation and types of fragmentation in Distributed Database
PPTX
CFG to CNF
DOCX
Blood donation
PPTX
SRS Document For Instagram
PPTX
Regular expressions
Ai 8 puzzle problem
Timestamp protocols
Remote Procedure Call in Distributed System
17. Recovery System in DBMS
Instruction level parallelism
Ch 7 Knowledge Representation.pdf
Software Engineering Assignment
Artificial Intelligence Notes Unit 2
Top down parsering and bottom up parsering.pptx
Online Job Portal ppt presentation
Code generation
Production System in AI
RECURSIVE DESCENT PARSING
Chaps 1-3-ai-prolog
Knowledge Representation, Inference and Reasoning
Fragmentation and types of fragmentation in Distributed Database
CFG to CNF
Blood donation
SRS Document For Instagram
Regular expressions
Ad

Similar to Compiler lab final report writing (20)

PDF
c_programming.pdf
PDF
Chapter 2 : Balagurusamy_ Programming ANsI in C
PDF
C programing Tutorial
PPT
UNIT-2-PPTS-DAA.ppt
PPTX
C programming language
PDF
Computer experiments 1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branch
PPT
C program
PPTX
C and C++ programming basics for Beginners.pptx
PDF
Week 02_Development Environment of C++.pdf
PDF
java or oops class not in kerala polytechnic 4rth semester nots j
PDF
The New Yorker cartoon premium membership of the
PDF
Software Quality Engineering
DOCX
Objectives Assignment 09 Applications of Stacks COS.docx
PDF
Introduction to programming : flowchart, algorithm
PDF
learn basic to advance C Programming Notes
PDF
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
PDF
Conditional Statements
PPTX
comp 122 Chapter 2.pptx,language semantics
PPTX
C programming
PPT
C material
c_programming.pdf
Chapter 2 : Balagurusamy_ Programming ANsI in C
C programing Tutorial
UNIT-2-PPTS-DAA.ppt
C programming language
Computer experiments 1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branch
C program
C and C++ programming basics for Beginners.pptx
Week 02_Development Environment of C++.pdf
java or oops class not in kerala polytechnic 4rth semester nots j
The New Yorker cartoon premium membership of the
Software Quality Engineering
Objectives Assignment 09 Applications of Stacks COS.docx
Introduction to programming : flowchart, algorithm
learn basic to advance C Programming Notes
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Conditional Statements
comp 122 Chapter 2.pptx,language semantics
C programming
C material
Ad

More from Umme habiba (20)

PPTX
online bus ticket booking system
PPTX
online bus ticket booking system
PPTX
online bus ticket booking system
PPT
Accounting adjusting
DOCX
Economic.assignment
DOCX
Major economic problems of bangladesh
PPT
Overview of various types of operating system
DOCX
Os lab report(shell coding)
PPTX
Ecommerce(online Shopping)
DOCX
Different types of Addressing.cao
PPTX
2nd generation of computer
DOCX
Art_of_living assignment
PPTX
Art_of_living
DOCX
Informationsecurity
PPT
SQL Joinning.Database
PPTX
WLAN of networking.ppt
PPTX
simpson's in numerical method
PPTX
Error detection in Data comunication
PPTX
microsoft word & powerpoint
PPTX
Upmovie review (1)
online bus ticket booking system
online bus ticket booking system
online bus ticket booking system
Accounting adjusting
Economic.assignment
Major economic problems of bangladesh
Overview of various types of operating system
Os lab report(shell coding)
Ecommerce(online Shopping)
Different types of Addressing.cao
2nd generation of computer
Art_of_living assignment
Art_of_living
Informationsecurity
SQL Joinning.Database
WLAN of networking.ppt
simpson's in numerical method
Error detection in Data comunication
microsoft word & powerpoint
Upmovie review (1)

Recently uploaded (20)

PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPT
Project quality management in manufacturing
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
Geodesy 1.pptx...............................................
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
PPT on Performance Review to get promotions
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
web development for engineering and engineering
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Sustainable Sites - Green Building Construction
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
Internet of Things (IOT) - A guide to understanding
CYBER-CRIMES AND SECURITY A guide to understanding
Model Code of Practice - Construction Work - 21102022 .pdf
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Project quality management in manufacturing
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Operating System & Kernel Study Guide-1 - converted.pdf
Geodesy 1.pptx...............................................
bas. eng. economics group 4 presentation 1.pptx
Foundation to blockchain - A guide to Blockchain Tech
PPT on Performance Review to get promotions
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
web development for engineering and engineering
CH1 Production IntroductoryConcepts.pptx
Sustainable Sites - Green Building Construction
Automation-in-Manufacturing-Chapter-Introduction.pdf
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS

Compiler lab final report writing

  • 1. LAB REPORT Regular Expression Course Code: CSE 331 Course Title: Compiler Design Submitted By Umme Habiba Id:142-15-3677 Section -B Submitted To Mr. Seraj Al Mahmud Mostafa Senior Lecturer Dept. Of Computer Science and Engineering Daffodil International University Submission Date: 17/04/2017
  • 2. Problem Statement: In this lab task, we will work on regular expressions. For simplicity, we will assume that there is a fixed set of regular expressions. We will not consider out of these. But we must not use any built-in method or package in our implementation .The selected Regular Expressions are: 1. a(bc)*de 2. a(bc)+de 3. a(bc)?de 4. [a-m]* 5. [^aeiou] 6. [^aeiou]{6} Here, '*' means occurrence of zero of more characters, '+' indicates happening of one or more characters, '?' means only once or not at all occurrence, '[ ]' indicates happening of inclusive characters, '^' indicates that next characters will not be used in the pattern, '[a-d]{3}' indicates that valid string will be exactly of length 3 inclusively using a, b, c, d. The program has to show “Accepted” if a given string is supported by a RE, otherwise, it will show “Not Accepted”.
  • 3. Input & Output Format: Here we work with a fixed set of regular expressions and will not consider out of these. Per RE will generate an individual answer and the given format is like that…. When we run our program, command prompt tells how many string we want to input and after input the 1st string it shows the individual output of the RE. The Input-Output format of our program is like… Variable Description: In our whole program we use some variables.The most important variables that used in our program are string,flag,flag2,flag3,I and n.
  • 4. String:This variable is a character array type variable that is used to store the string that user is given. Flag: This is a integer type variable. It helps our program to give output easier and accts as a status. Others: Here we also use some integer type variable and they helps for looping and keeping number. These are i,n. Algorithm Description: Algorithm that is used In our program to solve the problem more easier is given below: Algorithm: 1. Number input 2. For: Take input till number 3. String  input 4. For : Take string till null character 5. Check if the characters exists 6. If: exists 7. Print : Accepted 8. Else: 9. Print : Not Accepted 10. Return. The program starts with taking the string as input. Then, the program calls 6 function individually. The functions are: 1. zero_or_more(string) 2. one_or_more(string) 3. once_or_notAtAll(string) 4. character_class(string) 5. negationOf_character_class(string) 6.exactly_N_times(string)
  • 5. These all functions catch the input string parameters. Each function works with their own algorithm according to the problem domain to justify the input string is valid or not. Structure Diagram: Here we show a structure diagram as well as flow chart of our project is: Start Input a number,n (i=0) i Call the functions yesNot Accepted Satisfy RE?? Input a string i<n End i++ yesno i++
  • 6. CorrectnessArguments: As my algorithm works 100% properly to solve the RE problem and showing the expected output format result for the requirement, I honestly and truly can claim about it.There are some reasons why I claim about it- 1.Here in testing description section, I shall show the proof of my work that it can show output properly. 2.It shows the exact output what is wanted to show. 3.As I didn’t find any bug. TestDescription: A few Testing Screenshots of command prompt is shown in below:
  • 7. Known Bugs: I didn’t find any kind of bugs in my program. Comment: In the compiler, the most important topic is RE and I am happy for completing my final lab project according with this topic.I enjoy my code as some portion make me thoughtful. Contribution: As I complete the given project myself, there is no contribution of any partner.