SlideShare a Scribd company logo
1 of 9
Objective:To acquire a comprehensive understanding of the
application of grammars and formal language theory to
computing languages.Given:
Consider the following set of productions:
P01:
FN
→
FN–HEAD FN–BODY
P02:
FN–HEAD
→
TYPE id
(
PARAM–LIST
)
P03:
TYPE
→
char
P04:
TYPE
→
int
P05:
TYPE
→
real
P06:
PARAM–LIST
→
TYPE id
P07:
PARAM–LIST
→
PARAM–LIST
,
TYPE id
P08:
FN–BODY
→
{
VAR–DECL STMT
return (
EXPRESN
) ; }
P09:
VAR–DECL
→
λ
P10:
VAR–DECL
→
TYPE ID–LIST
;
P11:
VAR–DECL
→
VAR–DECL TYPE ID–LIST
;
P12:
ID–LIST
→
id
P13:
ID–LIST
→
ID–LIST
,
id
P14:
STMT
→
λ
P15:
STMT
→
SIMPLE–STMT
P16:
STMT
→
SELECT–STMT
P17:
STMT
→
REPEAT–STMT
P18:
STMT
→
SEQUENCE–STMT
P19:
SIMPLE–STMT
→
ASSIGN–STMT
P20:
SIMPLE–STMT
→
FN–CALL–STMT
P21:
ASSIGN–STMT
→
var
=
EXPRESN
;
P22:
EXPRESN
→
ARITH–EXP
P23:
EXPRESN
→
BOOL–EXP
P24:
ARITH–EXP
→
TERM
P25:
ARITH–EXP
→
ARITH–EXP ADD–OP TERM
P26:
ADD–OP
→
+
P27:
ADD–OP
→
–
P28:
TERM
→
FAC
P29:
TERM
→
TERM MUL–OP FAC
P30:
MUL–OP
→
*
P31:
MUL–OP
→
/
P32:
FAC
→
(
ARITH–EXP
)
P33:
FAC
→
OPD
P34:
OPD
→
var
P35:
OPD
→
const
P36:
BOOL–EXP
→
RELN–EXP
P37:
BOOL–EXP
→
LOGIC–EXP
P38:
RELN–EXP
→
OPD RELN–OPR OPD
P39:
RELN–OPR
→
==
P40:
RELN–OPR
→
!=
P41:
RELN–OPR
→
<
P42:
RELN–OPR
→
<=
P43:
RELN–OPR
→
>
P44:
RELN–OPR
→
>=
P45:
LOGIC–EXP
→
OPD LOGIC–OPR OPD
P46:
LOGIC–EXP
→
LOGIC–OPR OPD
P47:
LOGIC–OPR
→
and
P48:
LOGIC–OPR
→
or
P49:
LOGIC–OPR
→
not
P50:
FN–CALL–STMT
→
id
(
ARG–LIST
) ;
P51:
ARG–LIST
→
λ
P52:
ARG–LIST
→
id
P53:
ARG–LIST
→
ARG–LIST
,
id
P54:
SELECT–STMT
→
if
CONDITION STMT
else
STMT
P55:
CONDITION
→
(
BOOL–EXP
)
P56:
REPEAT–STMT
→
DO–STMT
P57:
REPEAT–STMT
→
WHILE–STMT
P58:
DO–STMT
→
do {
STMT
} while
CONDITION
;
P59:
WHILE–STMT
→
while
CONDITION
do {
STMT
} ;
P60:
SEQUENCE–STMT
→
STMT STMT
Instructions:
(30 points)
Rewrite the set of productions above in Extended Backus-
Naur Form (EBNF).
(35 points)
Using a Push Down Automaton (PDA), determine if the
following function is valid code according to the given set of
productions.
int Max ( int x, int y )
{
int z ;
if ( x >y )
z = x ;
else
z = y ;
return ( z ) ;
}
(35 points)
Validate your answer in (2) by illustrating it with a derivation
tree
Deliverable:
Submit a paper Times New Roman font, 12 pt., double-space
lines). The project must contain an introduction which
includes the purpose of the project.
I attached the answers to 1 and 2 just look to make sure correct
and write a paper.

More Related Content

More from IlonaThornburg83

Omit all general journal entry explanations.Be sure to include c.docx
Omit all general journal entry explanations.Be sure to include c.docxOmit all general journal entry explanations.Be sure to include c.docx
Omit all general journal entry explanations.Be sure to include c.docx
IlonaThornburg83
 
Offer an alternative explanation for how these patterns of criminal .docx
Offer an alternative explanation for how these patterns of criminal .docxOffer an alternative explanation for how these patterns of criminal .docx
Offer an alternative explanation for how these patterns of criminal .docx
IlonaThornburg83
 
Of the five management functions, which do you expect will experienc.docx
Of the five management functions, which do you expect will experienc.docxOf the five management functions, which do you expect will experienc.docx
Of the five management functions, which do you expect will experienc.docx
IlonaThornburg83
 
Obtaining informed consent for services from clients is required of .docx
Obtaining informed consent for services from clients is required of .docxObtaining informed consent for services from clients is required of .docx
Obtaining informed consent for services from clients is required of .docx
IlonaThornburg83
 
ObjectiveTo acquire a comprehensive understanding of the applic.docx
ObjectiveTo acquire a comprehensive understanding of the applic.docxObjectiveTo acquire a comprehensive understanding of the applic.docx
ObjectiveTo acquire a comprehensive understanding of the applic.docx
IlonaThornburg83
 

More from IlonaThornburg83 (20)

Once you have identified two questions that interest you, conduct an.docx
Once you have identified two questions that interest you, conduct an.docxOnce you have identified two questions that interest you, conduct an.docx
Once you have identified two questions that interest you, conduct an.docx
 
On December 31, 2015, Ms. Levine CPA, your manager and the treasurer.docx
On December 31, 2015, Ms. Levine CPA, your manager and the treasurer.docxOn December 31, 2015, Ms. Levine CPA, your manager and the treasurer.docx
On December 31, 2015, Ms. Levine CPA, your manager and the treasurer.docx
 
On Dumpster Diving” by Lars Eighner (50 Essays, p. 139-15.docx
On Dumpster Diving” by Lars Eighner (50 Essays, p. 139-15.docxOn Dumpster Diving” by Lars Eighner (50 Essays, p. 139-15.docx
On Dumpster Diving” by Lars Eighner (50 Essays, p. 139-15.docx
 
Ok so I have done all the calculations, graphs and interpritations m.docx
Ok so I have done all the calculations, graphs and interpritations m.docxOk so I have done all the calculations, graphs and interpritations m.docx
Ok so I have done all the calculations, graphs and interpritations m.docx
 
Ok so I know this is extreme short notice but I have a final 6 page .docx
Ok so I know this is extreme short notice but I have a final 6 page .docxOk so I know this is extreme short notice but I have a final 6 page .docx
Ok so I know this is extreme short notice but I have a final 6 page .docx
 
Offenses and Punishment. Please respond to the following Explai.docx
Offenses and Punishment. Please respond to the following Explai.docxOffenses and Punishment. Please respond to the following Explai.docx
Offenses and Punishment. Please respond to the following Explai.docx
 
Omit all general journal entry explanations.Be sure to include c.docx
Omit all general journal entry explanations.Be sure to include c.docxOmit all general journal entry explanations.Be sure to include c.docx
Omit all general journal entry explanations.Be sure to include c.docx
 
Offer an alternative explanation for how these patterns of criminal .docx
Offer an alternative explanation for how these patterns of criminal .docxOffer an alternative explanation for how these patterns of criminal .docx
Offer an alternative explanation for how these patterns of criminal .docx
 
Often, as a business operates, the partners bring some of their pers.docx
Often, as a business operates, the partners bring some of their pers.docxOften, as a business operates, the partners bring some of their pers.docx
Often, as a business operates, the partners bring some of their pers.docx
 
Of all the GNR technologies (genetic engineering, nanotechnology and.docx
Of all the GNR technologies (genetic engineering, nanotechnology and.docxOf all the GNR technologies (genetic engineering, nanotechnology and.docx
Of all the GNR technologies (genetic engineering, nanotechnology and.docx
 
Of the five management functions, which do you expect will experienc.docx
Of the five management functions, which do you expect will experienc.docxOf the five management functions, which do you expect will experienc.docx
Of the five management functions, which do you expect will experienc.docx
 
Of the numerous forms of communication technologies presented in thi.docx
Of the numerous forms of communication technologies presented in thi.docxOf the numerous forms of communication technologies presented in thi.docx
Of the numerous forms of communication technologies presented in thi.docx
 
Oceanic currents are an important mechanism for the transfer of ener.docx
Oceanic currents are an important mechanism for the transfer of ener.docxOceanic currents are an important mechanism for the transfer of ener.docx
Oceanic currents are an important mechanism for the transfer of ener.docx
 
Obtaining informed consent for services from clients is required of .docx
Obtaining informed consent for services from clients is required of .docxObtaining informed consent for services from clients is required of .docx
Obtaining informed consent for services from clients is required of .docx
 
Observe the block diagrams.  Place events in order of occurrence in .docx
Observe the block diagrams.  Place events in order of occurrence in .docxObserve the block diagrams.  Place events in order of occurrence in .docx
Observe the block diagrams.  Place events in order of occurrence in .docx
 
on 1.docx
on 1.docxon 1.docx
on 1.docx
 
On April 8, 2014 Microsoft ended support of its Windows XP operating.docx
On April 8, 2014 Microsoft ended support of its Windows XP operating.docxOn April 8, 2014 Microsoft ended support of its Windows XP operating.docx
On April 8, 2014 Microsoft ended support of its Windows XP operating.docx
 
Objective the students will be able to recognize the various genr.docx
Objective the students will be able to recognize the various genr.docxObjective the students will be able to recognize the various genr.docx
Objective the students will be able to recognize the various genr.docx
 
On a blog site, httpcuriosity.discovery.comquestionsuperhuman.docx
On a blog site, httpcuriosity.discovery.comquestionsuperhuman.docxOn a blog site, httpcuriosity.discovery.comquestionsuperhuman.docx
On a blog site, httpcuriosity.discovery.comquestionsuperhuman.docx
 
ObjectiveTo acquire a comprehensive understanding of the applic.docx
ObjectiveTo acquire a comprehensive understanding of the applic.docxObjectiveTo acquire a comprehensive understanding of the applic.docx
ObjectiveTo acquire a comprehensive understanding of the applic.docx
 

Recently uploaded

MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MysoreMuleSoftMeetup
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
中 央社
 
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
 

Recently uploaded (20)

COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
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
 
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
 
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"
 
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
 
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...
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
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
 
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
 
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
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
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...
 
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
 
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
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
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
 

ObjectiveTo acquire a comprehensive understanding of the applicatio.docx