SlideShare a Scribd company logo
1 of 1
Download to read offline
Given the grammar below, provide a leftmost derivation for the given input string: TOKENS:
INT for integers, VAR for single letter, +. *, (, ) GRAMMAR: E::= T {+ E} T::= P{* T} P::=
INT | VAR|(E) INPUT STRING: a*(a+b)
Solution
Left most derivation means that you start from the start and start making projection. At every
point you resolve the left most nonterminal symbol.
E => T => P*T => a*T => a*P => a*(E) => a*(T+E) => a*(P+E) => a*(a+E) => a*(a+T) =>
a*(a+P) => a*(a+b)

More Related Content

More from arkleatheray

^^^Q3. I am trying to implement double linked list but I was faile.pdf
^^^Q3. I am trying to implement double linked list but I was faile.pdf^^^Q3. I am trying to implement double linked list but I was faile.pdf
^^^Q3. I am trying to implement double linked list but I was faile.pdf
arkleatheray
 
What is the evolutionary basis for sexual reproductionSolution.pdf
What is the evolutionary basis for sexual reproductionSolution.pdfWhat is the evolutionary basis for sexual reproductionSolution.pdf
What is the evolutionary basis for sexual reproductionSolution.pdf
arkleatheray
 
Why is it that the Grams stain is not appropriate for acid fast ba.pdf
Why is it that the Grams stain is not appropriate for acid fast ba.pdfWhy is it that the Grams stain is not appropriate for acid fast ba.pdf
Why is it that the Grams stain is not appropriate for acid fast ba.pdf
arkleatheray
 
Why does this version of the swap function fail to work Is there a f.pdf
Why does this version of the swap function fail to work Is there a f.pdfWhy does this version of the swap function fail to work Is there a f.pdf
Why does this version of the swap function fail to work Is there a f.pdf
arkleatheray
 
The groin is also known as the _____ region. crural inguinal perin.pdf
The groin is also known as the _____ region.  crural  inguinal  perin.pdfThe groin is also known as the _____ region.  crural  inguinal  perin.pdf
The groin is also known as the _____ region. crural inguinal perin.pdf
arkleatheray
 
Security Challenges Please respond to the followingDistributed .pdf
Security Challenges Please respond to the followingDistributed .pdfSecurity Challenges Please respond to the followingDistributed .pdf
Security Challenges Please respond to the followingDistributed .pdf
arkleatheray
 
Question 5 Checkboxes,Radio Buttons, and JTextAreaWrite a program.pdf
Question 5 Checkboxes,Radio Buttons, and JTextAreaWrite a program.pdfQuestion 5 Checkboxes,Radio Buttons, and JTextAreaWrite a program.pdf
Question 5 Checkboxes,Radio Buttons, and JTextAreaWrite a program.pdf
arkleatheray
 
1. Find at least two (2) organizations that are available in the sta.pdf
1. Find at least two (2) organizations that are available in the sta.pdf1. Find at least two (2) organizations that are available in the sta.pdf
1. Find at least two (2) organizations that are available in the sta.pdf
arkleatheray
 
3. Describe the five basic attacks on authentication systems.4. De.pdf
3. Describe the five basic attacks on authentication systems.4. De.pdf3. Describe the five basic attacks on authentication systems.4. De.pdf
3. Describe the five basic attacks on authentication systems.4. De.pdf
arkleatheray
 

More from arkleatheray (20)

What is a view What is it used for Give examples when a view can b.pdf
What is a view What is it used for Give examples when a view can b.pdfWhat is a view What is it used for Give examples when a view can b.pdf
What is a view What is it used for Give examples when a view can b.pdf
 
^^^Q3. I am trying to implement double linked list but I was faile.pdf
^^^Q3. I am trying to implement double linked list but I was faile.pdf^^^Q3. I am trying to implement double linked list but I was faile.pdf
^^^Q3. I am trying to implement double linked list but I was faile.pdf
 
What is the evolutionary basis for sexual reproductionSolution.pdf
What is the evolutionary basis for sexual reproductionSolution.pdfWhat is the evolutionary basis for sexual reproductionSolution.pdf
What is the evolutionary basis for sexual reproductionSolution.pdf
 
Why is it that the Grams stain is not appropriate for acid fast ba.pdf
Why is it that the Grams stain is not appropriate for acid fast ba.pdfWhy is it that the Grams stain is not appropriate for acid fast ba.pdf
Why is it that the Grams stain is not appropriate for acid fast ba.pdf
 
Why does this version of the swap function fail to work Is there a f.pdf
Why does this version of the swap function fail to work Is there a f.pdfWhy does this version of the swap function fail to work Is there a f.pdf
Why does this version of the swap function fail to work Is there a f.pdf
 
Which of the following is NOT a reason why heat is a bad method to ov.pdf
Which of the following is NOT a reason why heat is a bad method to ov.pdfWhich of the following is NOT a reason why heat is a bad method to ov.pdf
Which of the following is NOT a reason why heat is a bad method to ov.pdf
 
What are the trends in browsersSolution1.chrome Google chrom.pdf
What are the trends in browsersSolution1.chrome Google chrom.pdfWhat are the trends in browsersSolution1.chrome Google chrom.pdf
What are the trends in browsersSolution1.chrome Google chrom.pdf
 
The probability of a persons being left-handed is .12. In the 1992.pdf
The probability of a persons being left-handed is .12. In the 1992.pdfThe probability of a persons being left-handed is .12. In the 1992.pdf
The probability of a persons being left-handed is .12. In the 1992.pdf
 
The mass of a radioactive substance follows a continuous exponential.pdf
The mass of a radioactive substance follows a continuous exponential.pdfThe mass of a radioactive substance follows a continuous exponential.pdf
The mass of a radioactive substance follows a continuous exponential.pdf
 
The groin is also known as the _____ region. crural inguinal perin.pdf
The groin is also known as the _____ region.  crural  inguinal  perin.pdfThe groin is also known as the _____ region.  crural  inguinal  perin.pdf
The groin is also known as the _____ region. crural inguinal perin.pdf
 
short answer List and describe two advances during the Industrial Re.pdf
short answer List and describe two advances during the Industrial Re.pdfshort answer List and describe two advances during the Industrial Re.pdf
short answer List and describe two advances during the Industrial Re.pdf
 
SheilaSalmonella agar is _ because _ breaks down amino acids that co.pdf
SheilaSalmonella agar is _ because _ breaks down amino acids that co.pdfSheilaSalmonella agar is _ because _ breaks down amino acids that co.pdf
SheilaSalmonella agar is _ because _ breaks down amino acids that co.pdf
 
Security Challenges Please respond to the followingDistributed .pdf
Security Challenges Please respond to the followingDistributed .pdfSecurity Challenges Please respond to the followingDistributed .pdf
Security Challenges Please respond to the followingDistributed .pdf
 
Sapling Learning There are several methods by which genetic material .pdf
Sapling Learning There are several methods by which genetic material .pdfSapling Learning There are several methods by which genetic material .pdf
Sapling Learning There are several methods by which genetic material .pdf
 
Question 5 Checkboxes,Radio Buttons, and JTextAreaWrite a program.pdf
Question 5 Checkboxes,Radio Buttons, and JTextAreaWrite a program.pdfQuestion 5 Checkboxes,Radio Buttons, and JTextAreaWrite a program.pdf
Question 5 Checkboxes,Radio Buttons, and JTextAreaWrite a program.pdf
 
1. Find at least two (2) organizations that are available in the sta.pdf
1. Find at least two (2) organizations that are available in the sta.pdf1. Find at least two (2) organizations that are available in the sta.pdf
1. Find at least two (2) organizations that are available in the sta.pdf
 
Pros and Cons of these APIs Strava pros cons Gruvr pros co.pdf
Pros and Cons of these APIs  Strava  pros  cons  Gruvr  pros  co.pdfPros and Cons of these APIs  Strava  pros  cons  Gruvr  pros  co.pdf
Pros and Cons of these APIs Strava pros cons Gruvr pros co.pdf
 
PLEASE show all worksteps and expalin fullySolutionnull h.pdf
PLEASE show all worksteps and expalin fullySolutionnull h.pdfPLEASE show all worksteps and expalin fullySolutionnull h.pdf
PLEASE show all worksteps and expalin fullySolutionnull h.pdf
 
Plants, fungi, and animals all have EUKARYOTIC cells. This is due to.pdf
Plants, fungi, and animals all have EUKARYOTIC cells. This is due to.pdfPlants, fungi, and animals all have EUKARYOTIC cells. This is due to.pdf
Plants, fungi, and animals all have EUKARYOTIC cells. This is due to.pdf
 
3. Describe the five basic attacks on authentication systems.4. De.pdf
3. Describe the five basic attacks on authentication systems.4. De.pdf3. Describe the five basic attacks on authentication systems.4. De.pdf
3. Describe the five basic attacks on authentication systems.4. De.pdf
 

Recently uploaded

Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
EADTU
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
Peter Brusilovsky
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
中 央社
 

Recently uploaded (20)

How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptx
 
Book Review of Run For Your Life Powerpoint
Book Review of Run For Your Life PowerpointBook Review of Run For Your Life Powerpoint
Book Review of Run For Your Life Powerpoint
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 

Given the grammar below, provide a leftmost derivation for the given .pdf

  • 1. Given the grammar below, provide a leftmost derivation for the given input string: TOKENS: INT for integers, VAR for single letter, +. *, (, ) GRAMMAR: E::= T {+ E} T::= P{* T} P::= INT | VAR|(E) INPUT STRING: a*(a+b) Solution Left most derivation means that you start from the start and start making projection. At every point you resolve the left most nonterminal symbol. E => T => P*T => a*T => a*P => a*(E) => a*(T+E) => a*(P+E) => a*(a+E) => a*(a+T) => a*(a+P) => a*(a+b)