SlideShare una empresa de Scribd logo
1 de 7
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.

Más contenido relacionado

La actualidad más candente

Mid point line Algorithm - Computer Graphics
Mid point line Algorithm - Computer GraphicsMid point line Algorithm - Computer Graphics
Mid point line Algorithm - Computer GraphicsDrishti Bhalla
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMvikas dhakane
 
Data structures - unit 1
Data structures - unit 1Data structures - unit 1
Data structures - unit 1SaranyaP45
 
FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT03062679929
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)swapnac12
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer GraphicsAnkur Soni
 
Graph in data structure
Graph in data structureGraph in data structure
Graph in data structureAbrish06
 
3 Tier Architecture
3 Tier Architecture3 Tier Architecture
3 Tier Architectureguestd0cc01
 
Polygon filling algorithm
Polygon filling algorithmPolygon filling algorithm
Polygon filling algorithmAparna Joshi
 

La actualidad más candente (20)

Mid point line Algorithm - Computer Graphics
Mid point line Algorithm - Computer GraphicsMid point line Algorithm - Computer Graphics
Mid point line Algorithm - Computer Graphics
 
Binary Tree Traversal
Binary Tree TraversalBinary Tree Traversal
Binary Tree Traversal
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHM
 
Dbms lab questions
Dbms lab questionsDbms lab questions
Dbms lab questions
 
Data structures - unit 1
Data structures - unit 1Data structures - unit 1
Data structures - unit 1
 
Graph coloring using backtracking
Graph coloring using backtrackingGraph coloring using backtracking
Graph coloring using backtracking
 
grocery management system
grocery  management systemgrocery  management system
grocery management system
 
CS8391 Data Structures Part B Questions Anna University
CS8391 Data Structures Part B Questions Anna UniversityCS8391 Data Structures Part B Questions Anna University
CS8391 Data Structures Part B Questions Anna University
 
FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT
 
Queue ppt
Queue pptQueue ppt
Queue ppt
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
 
Tree - Data Structure
Tree - Data StructureTree - Data Structure
Tree - Data Structure
 
Unit 1 chapter 1 Design and Analysis of Algorithms
Unit 1   chapter 1 Design and Analysis of AlgorithmsUnit 1   chapter 1 Design and Analysis of Algorithms
Unit 1 chapter 1 Design and Analysis of Algorithms
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
 
Database connectivity in python
Database connectivity in pythonDatabase connectivity in python
Database connectivity in python
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
tic-tac-toe: Game playing
 tic-tac-toe: Game playing tic-tac-toe: Game playing
tic-tac-toe: Game playing
 
Graph in data structure
Graph in data structureGraph in data structure
Graph in data structure
 
3 Tier Architecture
3 Tier Architecture3 Tier Architecture
3 Tier Architecture
 
Polygon filling algorithm
Polygon filling algorithmPolygon filling algorithm
Polygon filling algorithm
 

Similar a Compiler lab final report writing

c_programming.pdf
c_programming.pdfc_programming.pdf
c_programming.pdfHome
 
Chapter 2 : Balagurusamy_ Programming ANsI in C
Chapter 2 :  Balagurusamy_ Programming ANsI in CChapter 2 :  Balagurusamy_ Programming ANsI in C
Chapter 2 : Balagurusamy_ Programming ANsI in CBUBT
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing TutorialMahira Banu
 
C programming language
C programming languageC programming language
C programming languageAbin Rimal
 
Computer experiments 1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branch
Computer experiments   1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branchComputer experiments   1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branch
Computer experiments 1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branchSAKSHIGAWADE2
 
Objectives Assignment 09 Applications of Stacks COS.docx
Objectives Assignment 09 Applications of Stacks COS.docxObjectives Assignment 09 Applications of Stacks COS.docx
Objectives Assignment 09 Applications of Stacks COS.docxdunhamadell
 
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...Udayan Khattry
 
C++ programming language basic to advance level
C++ programming language basic to advance levelC++ programming language basic to advance level
C++ programming language basic to advance levelsajjad ali khan
 
Algorithms notes 2 tutorials duniya
Algorithms notes 2   tutorials duniyaAlgorithms notes 2   tutorials duniya
Algorithms notes 2 tutorials duniyaTutorialsDuniya.com
 
CIS 1403 lab 3 functions and methods in Java
CIS 1403 lab 3 functions and methods in JavaCIS 1403 lab 3 functions and methods in Java
CIS 1403 lab 3 functions and methods in JavaHamad Odhabi
 

Similar a Compiler lab final report writing (20)

c_programming.pdf
c_programming.pdfc_programming.pdf
c_programming.pdf
 
Chapter 2 : Balagurusamy_ Programming ANsI in C
Chapter 2 :  Balagurusamy_ Programming ANsI in CChapter 2 :  Balagurusamy_ Programming ANsI in C
Chapter 2 : Balagurusamy_ Programming ANsI in C
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing Tutorial
 
UNIT-2-PPTS-DAA.ppt
UNIT-2-PPTS-DAA.pptUNIT-2-PPTS-DAA.ppt
UNIT-2-PPTS-DAA.ppt
 
C programming language
C programming languageC programming language
C programming language
 
Computer experiments 1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branch
Computer experiments   1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branchComputer experiments   1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branch
Computer experiments 1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branch
 
C program
C programC program
C program
 
Software Quality Engineering
Software Quality EngineeringSoftware Quality Engineering
Software Quality Engineering
 
Objectives Assignment 09 Applications of Stacks COS.docx
Objectives Assignment 09 Applications of Stacks COS.docxObjectives Assignment 09 Applications of Stacks COS.docx
Objectives Assignment 09 Applications of Stacks COS.docx
 
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
 
Conditional Statements
Conditional StatementsConditional Statements
Conditional Statements
 
C programming
C programmingC programming
C programming
 
C material
C materialC material
C material
 
DATA STRUCTURE.pdf
DATA STRUCTURE.pdfDATA STRUCTURE.pdf
DATA STRUCTURE.pdf
 
DATA STRUCTURE
DATA STRUCTUREDATA STRUCTURE
DATA STRUCTURE
 
C++ programming language basic to advance level
C++ programming language basic to advance levelC++ programming language basic to advance level
C++ programming language basic to advance level
 
Algorithms notes 2 tutorials duniya
Algorithms notes 2   tutorials duniyaAlgorithms notes 2   tutorials duniya
Algorithms notes 2 tutorials duniya
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
 
Introduction
IntroductionIntroduction
Introduction
 
CIS 1403 lab 3 functions and methods in Java
CIS 1403 lab 3 functions and methods in JavaCIS 1403 lab 3 functions and methods in Java
CIS 1403 lab 3 functions and methods in Java
 

Más de Umme habiba

online bus ticket booking system
online bus ticket booking systemonline bus ticket booking system
online bus ticket booking systemUmme habiba
 
online bus ticket booking system
online bus ticket booking systemonline bus ticket booking system
online bus ticket booking systemUmme habiba
 
online bus ticket booking system
online bus ticket booking systemonline bus ticket booking system
online bus ticket booking systemUmme habiba
 
Accounting adjusting
Accounting adjustingAccounting adjusting
Accounting adjustingUmme habiba
 
Economic.assignment
Economic.assignmentEconomic.assignment
Economic.assignmentUmme habiba
 
Major economic problems of bangladesh
Major economic problems of bangladeshMajor economic problems of bangladesh
Major economic problems of bangladeshUmme habiba
 
Overview of various types of operating system
Overview of various types of operating systemOverview of various types of operating system
Overview of various types of operating systemUmme habiba
 
Os lab report(shell coding)
Os lab report(shell coding)Os lab report(shell coding)
Os lab report(shell coding)Umme habiba
 
Ecommerce(online Shopping)
Ecommerce(online Shopping)Ecommerce(online Shopping)
Ecommerce(online Shopping)Umme habiba
 
Different types of Addressing.cao
Different types of Addressing.caoDifferent types of Addressing.cao
Different types of Addressing.caoUmme habiba
 
2nd generation of computer
2nd generation of computer2nd generation of computer
2nd generation of computerUmme habiba
 
Art_of_living assignment
Art_of_living assignmentArt_of_living assignment
Art_of_living assignmentUmme habiba
 
Informationsecurity
InformationsecurityInformationsecurity
InformationsecurityUmme habiba
 
SQL Joinning.Database
SQL Joinning.DatabaseSQL Joinning.Database
SQL Joinning.DatabaseUmme habiba
 
WLAN of networking.ppt
WLAN of networking.pptWLAN of networking.ppt
WLAN of networking.pptUmme habiba
 
simpson's in numerical method
simpson's in numerical methodsimpson's in numerical method
simpson's in numerical methodUmme habiba
 
Error detection in Data comunication
 Error detection in Data comunication Error detection in Data comunication
Error detection in Data comunicationUmme habiba
 
microsoft word & powerpoint
 microsoft word & powerpoint microsoft word & powerpoint
microsoft word & powerpointUmme habiba
 
Upmovie review (1)
Upmovie review (1)Upmovie review (1)
Upmovie review (1)Umme habiba
 

Más de Umme habiba (20)

online bus ticket booking system
online bus ticket booking systemonline bus ticket booking system
online bus ticket booking system
 
online bus ticket booking system
online bus ticket booking systemonline bus ticket booking system
online bus ticket booking system
 
online bus ticket booking system
online bus ticket booking systemonline bus ticket booking system
online bus ticket booking system
 
Accounting adjusting
Accounting adjustingAccounting adjusting
Accounting adjusting
 
Economic.assignment
Economic.assignmentEconomic.assignment
Economic.assignment
 
Major economic problems of bangladesh
Major economic problems of bangladeshMajor economic problems of bangladesh
Major economic problems of bangladesh
 
Overview of various types of operating system
Overview of various types of operating systemOverview of various types of operating system
Overview of various types of operating system
 
Os lab report(shell coding)
Os lab report(shell coding)Os lab report(shell coding)
Os lab report(shell coding)
 
Ecommerce(online Shopping)
Ecommerce(online Shopping)Ecommerce(online Shopping)
Ecommerce(online Shopping)
 
Different types of Addressing.cao
Different types of Addressing.caoDifferent types of Addressing.cao
Different types of Addressing.cao
 
2nd generation of computer
2nd generation of computer2nd generation of computer
2nd generation of computer
 
Art_of_living assignment
Art_of_living assignmentArt_of_living assignment
Art_of_living assignment
 
Art_of_living
Art_of_livingArt_of_living
Art_of_living
 
Informationsecurity
InformationsecurityInformationsecurity
Informationsecurity
 
SQL Joinning.Database
SQL Joinning.DatabaseSQL Joinning.Database
SQL Joinning.Database
 
WLAN of networking.ppt
WLAN of networking.pptWLAN of networking.ppt
WLAN of networking.ppt
 
simpson's in numerical method
simpson's in numerical methodsimpson's in numerical method
simpson's in numerical method
 
Error detection in Data comunication
 Error detection in Data comunication Error detection in Data comunication
Error detection in Data comunication
 
microsoft word & powerpoint
 microsoft word & powerpoint microsoft word & powerpoint
microsoft word & powerpoint
 
Upmovie review (1)
Upmovie review (1)Upmovie review (1)
Upmovie review (1)
 

Último

11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdfHafizMudaserAhmad
 
KCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitosKCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitosVictor Morales
 
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSneha Padhiar
 
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHTEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHSneha Padhiar
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsResearcher Researcher
 
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...Stork
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptxmohitesoham12
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solidnamansinghjarodiya
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communicationpanditadesh123
 
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书rnrncn29
 
Levelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodLevelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodManicka Mamallan Andavar
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfModule-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfManish Kumar
 
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptJohnWilliam111370
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingBootNeck1
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxRomil Mishra
 
Artificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewArtificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewsandhya757531
 
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdfDEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdfAkritiPradhan2
 

Último (20)

11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf
 
KCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitosKCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitos
 
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
 
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHTEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending Actuators
 
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptx
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solid
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communication
 
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
 
Levelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodLevelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument method
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfModule-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
 
Designing pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptxDesigning pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptx
 
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event Scheduling
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptx
 
Artificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewArtificial Intelligence in Power System overview
Artificial Intelligence in Power System overview
 
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdfDEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdf
 

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.