SlideShare a Scribd company logo
1 of 1
Download to read offline
Recall the unambiguous grammar for arithmetic expressions discussed in class:
Modify this grammar to allow an exponentiation operator, ^, so that we can write expressions
like i+i^i*i. Of course, your modified grammar should be unambiguous. Give exponentiation
higher precedence than the other binary operators and (unlike the other binary operators) make it
associate to the right.
Solution
E -> E+T | E-T | T
T -> T*Y | T/Y | Y
Y -> F^Y | F
F -> i | (E)
with the above modified grammer you can easily write expresions like i+i^i*i and

More Related Content

More from eyevisioncare1

The memory cycle times have been much longer than processor cycle ti.pdf
The memory cycle times have been much longer than processor cycle ti.pdfThe memory cycle times have been much longer than processor cycle ti.pdf
The memory cycle times have been much longer than processor cycle ti.pdf
eyevisioncare1
 
Suppose you land on a previously unexplored South Pacific island. Yo.pdf
Suppose you land on a previously unexplored South Pacific island. Yo.pdfSuppose you land on a previously unexplored South Pacific island. Yo.pdf
Suppose you land on a previously unexplored South Pacific island. Yo.pdf
eyevisioncare1
 
State two factors that have contributed to the development of emergi.pdf
State two factors that have contributed to the development of emergi.pdfState two factors that have contributed to the development of emergi.pdf
State two factors that have contributed to the development of emergi.pdf
eyevisioncare1
 
Research and prepare a presentation to demonstrate a scenario in whi.pdf
Research and prepare a presentation to demonstrate a scenario in whi.pdfResearch and prepare a presentation to demonstrate a scenario in whi.pdf
Research and prepare a presentation to demonstrate a scenario in whi.pdf
eyevisioncare1
 
QUESTION 1Which ecological niche described below possesses the gre.pdf
QUESTION 1Which ecological niche described below possesses the gre.pdfQUESTION 1Which ecological niche described below possesses the gre.pdf
QUESTION 1Which ecological niche described below possesses the gre.pdf
eyevisioncare1
 
4. Proper planning of a software project unless the project is trivia.pdf
4. Proper planning of a software project unless the project is trivia.pdf4. Proper planning of a software project unless the project is trivia.pdf
4. Proper planning of a software project unless the project is trivia.pdf
eyevisioncare1
 

More from eyevisioncare1 (20)

What are the major inputs to the MRP systemSolutionMaterial r.pdf
What are the major inputs to the MRP systemSolutionMaterial r.pdfWhat are the major inputs to the MRP systemSolutionMaterial r.pdf
What are the major inputs to the MRP systemSolutionMaterial r.pdf
 
Type I alveolar cells(a) allow rapid diffusion of gases through t.pdf
Type I alveolar cells(a) allow rapid diffusion of gases through t.pdfType I alveolar cells(a) allow rapid diffusion of gases through t.pdf
Type I alveolar cells(a) allow rapid diffusion of gases through t.pdf
 
The memory cycle times have been much longer than processor cycle ti.pdf
The memory cycle times have been much longer than processor cycle ti.pdfThe memory cycle times have been much longer than processor cycle ti.pdf
The memory cycle times have been much longer than processor cycle ti.pdf
 
Suppose you land on a previously unexplored South Pacific island. Yo.pdf
Suppose you land on a previously unexplored South Pacific island. Yo.pdfSuppose you land on a previously unexplored South Pacific island. Yo.pdf
Suppose you land on a previously unexplored South Pacific island. Yo.pdf
 
State two factors that have contributed to the development of emergi.pdf
State two factors that have contributed to the development of emergi.pdfState two factors that have contributed to the development of emergi.pdf
State two factors that have contributed to the development of emergi.pdf
 
Research and prepare a presentation to demonstrate a scenario in whi.pdf
Research and prepare a presentation to demonstrate a scenario in whi.pdfResearch and prepare a presentation to demonstrate a scenario in whi.pdf
Research and prepare a presentation to demonstrate a scenario in whi.pdf
 
QUESTION 1Which ecological niche described below possesses the gre.pdf
QUESTION 1Which ecological niche described below possesses the gre.pdfQUESTION 1Which ecological niche described below possesses the gre.pdf
QUESTION 1Which ecological niche described below possesses the gre.pdf
 
Practice assembly question need helpGiven the following array decl.pdf
Practice assembly question need helpGiven the following array decl.pdfPractice assembly question need helpGiven the following array decl.pdf
Practice assembly question need helpGiven the following array decl.pdf
 
Peripheral proteins function primarily as ion channels and active tra.pdf
Peripheral proteins function primarily as ion channels and active tra.pdfPeripheral proteins function primarily as ion channels and active tra.pdf
Peripheral proteins function primarily as ion channels and active tra.pdf
 
One of the main purposes of a bus system is to allow the exchange of.pdf
One of the main purposes of a bus system is to allow the exchange of.pdfOne of the main purposes of a bus system is to allow the exchange of.pdf
One of the main purposes of a bus system is to allow the exchange of.pdf
 
Most Americans are immune to the bacterium that causes Leprosy, do.pdf
Most Americans are immune to the bacterium that causes Leprosy, do.pdfMost Americans are immune to the bacterium that causes Leprosy, do.pdf
Most Americans are immune to the bacterium that causes Leprosy, do.pdf
 
Looking at the symptoms of SARS is not really enough to diagnose it..pdf
Looking at the symptoms of SARS is not really enough to diagnose it..pdfLooking at the symptoms of SARS is not really enough to diagnose it..pdf
Looking at the symptoms of SARS is not really enough to diagnose it..pdf
 
Jurisdiction can be described asa. the study of law.b. court cas.pdf
Jurisdiction can be described asa. the study of law.b. court cas.pdfJurisdiction can be described asa. the study of law.b. court cas.pdf
Jurisdiction can be described asa. the study of law.b. court cas.pdf
 
In primate dentition, the left side of a jaw is identical to the rig.pdf
In primate dentition, the left side of a jaw is identical to the rig.pdfIn primate dentition, the left side of a jaw is identical to the rig.pdf
In primate dentition, the left side of a jaw is identical to the rig.pdf
 
A fruit fly with the genotype st+st;bw+bw has eyes that are what c.pdf
A fruit fly with the genotype st+st;bw+bw has eyes that are what c.pdfA fruit fly with the genotype st+st;bw+bw has eyes that are what c.pdf
A fruit fly with the genotype st+st;bw+bw has eyes that are what c.pdf
 
I need help understanding how this linked list set method works in j.pdf
I need help understanding how this linked list set method works in j.pdfI need help understanding how this linked list set method works in j.pdf
I need help understanding how this linked list set method works in j.pdf
 
How does friction heating effect pressure dropSolutionHeat tr.pdf
How does friction heating effect pressure dropSolutionHeat tr.pdfHow does friction heating effect pressure dropSolutionHeat tr.pdf
How does friction heating effect pressure dropSolutionHeat tr.pdf
 
HELP!!! Ive looked up online cut cant seem to find this answer. Use .pdf
HELP!!! Ive looked up online cut cant seem to find this answer. Use .pdfHELP!!! Ive looked up online cut cant seem to find this answer. Use .pdf
HELP!!! Ive looked up online cut cant seem to find this answer. Use .pdf
 
4. Proper planning of a software project unless the project is trivia.pdf
4. Proper planning of a software project unless the project is trivia.pdf4. Proper planning of a software project unless the project is trivia.pdf
4. Proper planning of a software project unless the project is trivia.pdf
 
explain why When the alternative hypothesis states that the differen.pdf
explain why When the alternative hypothesis states that the differen.pdfexplain why When the alternative hypothesis states that the differen.pdf
explain why When the alternative hypothesis states that the differen.pdf
 

Recently uploaded

SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 
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
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
中 央社
 

Recently uploaded (20)

Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
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...
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
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
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
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
 
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
 
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
 
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
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 

Recall the unambiguous grammar for arithmetic expressions discussed .pdf

  • 1. Recall the unambiguous grammar for arithmetic expressions discussed in class: Modify this grammar to allow an exponentiation operator, ^, so that we can write expressions like i+i^i*i. Of course, your modified grammar should be unambiguous. Give exponentiation higher precedence than the other binary operators and (unlike the other binary operators) make it associate to the right. Solution E -> E+T | E-T | T T -> T*Y | T/Y | Y Y -> F^Y | F F -> i | (E) with the above modified grammer you can easily write expresions like i+i^i*i and