SlideShare a Scribd company logo
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

DOCX
ObjectiveTo acquire a comprehensive understanding of the applicatio.docx
IlonaThornburg83
 
DOCX
PROJECT ON GRAMMARSCourseIST 230CMPSC 360Deadlinesee th.docx
briancrawford30935
 
DOCX
V cse cs6503 model qb1 1
Ezhumalai p
 
PDF
Declarative Syntax Definition - Grammars and Trees
Guido Wachsmuth
 
DOCX
Cs6660 compiler design may june 2016 Answer Key
appasami
 
PDF
RChain - Understanding Distributed Calculi
Pawel Szulc
 
PDF
Formal Grammars
Eelco Visser
 
PDF
Cs2303 theory of computation all anna University question papers
appasami
 
ObjectiveTo acquire a comprehensive understanding of the applicatio.docx
IlonaThornburg83
 
PROJECT ON GRAMMARSCourseIST 230CMPSC 360Deadlinesee th.docx
briancrawford30935
 
V cse cs6503 model qb1 1
Ezhumalai p
 
Declarative Syntax Definition - Grammars and Trees
Guido Wachsmuth
 
Cs6660 compiler design may june 2016 Answer Key
appasami
 
RChain - Understanding Distributed Calculi
Pawel Szulc
 
Formal Grammars
Eelco Visser
 
Cs2303 theory of computation all anna University question papers
appasami
 

Similar to ObjectiveTo acquire a comprehensive understanding of the applic.docx (20)

DOC
Model toc
GUNASUNDARI C
 
DOCX
Cs6503 theory of computation november december 2016
appasami
 
PPTX
PROLOG: Clauses Grammer In Prolog
DataminingTools Inc
 
PPTX
PROLOG: Clauses Grammer In Prolog
PROLOG CONTENT
 
PDF
Cs2303 theory of computation november december 2015
appasami
 
DOCX
CSC8503 Principles of Programming Languages Semester 1, 2015.docx
faithxdunce63732
 
PDF
TOC question bank.pdf
MrRRajasekarCSE
 
DOCX
theory of computation notes for school of engineering
FIONACHATOLA
 
PDF
Understanding distributed calculi in Haskell
Pawel Szulc
 
DOCX
COMM 166 Final Research Proposal GuidelinesThe proposal should.docx
monicafrancis71118
 
PPT
Pushdown automata
parmeet834
 
PPT
Pushdown automata
eugenesri
 
PPT
PushdownAutomata.ppt
RSRS39
 
DOCX
COMM 166 Final Research Proposal GuidelinesThe proposal should.docx
cargillfilberto
 
DOCX
COMM 166 Final Research Proposal GuidelinesThe proposal should.docx
drandy1
 
PDF
Bc0052 theory of computer science-mqp
Suhas Jogale
 
PPT
Semantic Analyzer.pptSemantic Analyzerpt
Aliza530614
 
PDF
Declarative Type System Specification with Statix
Eelco Visser
 
PPT
PushdownAutomata and Turing machines ppt
latha2009
 
PDF
U21CS502--Compiler Design--Question Bank
NISHASOMSCS113
 
Model toc
GUNASUNDARI C
 
Cs6503 theory of computation november december 2016
appasami
 
PROLOG: Clauses Grammer In Prolog
DataminingTools Inc
 
PROLOG: Clauses Grammer In Prolog
PROLOG CONTENT
 
Cs2303 theory of computation november december 2015
appasami
 
CSC8503 Principles of Programming Languages Semester 1, 2015.docx
faithxdunce63732
 
TOC question bank.pdf
MrRRajasekarCSE
 
theory of computation notes for school of engineering
FIONACHATOLA
 
Understanding distributed calculi in Haskell
Pawel Szulc
 
COMM 166 Final Research Proposal GuidelinesThe proposal should.docx
monicafrancis71118
 
Pushdown automata
parmeet834
 
Pushdown automata
eugenesri
 
PushdownAutomata.ppt
RSRS39
 
COMM 166 Final Research Proposal GuidelinesThe proposal should.docx
cargillfilberto
 
COMM 166 Final Research Proposal GuidelinesThe proposal should.docx
drandy1
 
Bc0052 theory of computer science-mqp
Suhas Jogale
 
Semantic Analyzer.pptSemantic Analyzerpt
Aliza530614
 
Declarative Type System Specification with Statix
Eelco Visser
 
PushdownAutomata and Turing machines ppt
latha2009
 
U21CS502--Compiler Design--Question Bank
NISHASOMSCS113
 
Ad

More from IlonaThornburg83 (20)

DOCX
One aspect of epidemiology is the study of the epidemic, endemic, an.docx
IlonaThornburg83
 
DOCX
Once you click the Assignment icon above, you will find links to Qui.docx
IlonaThornburg83
 
DOCX
one day when you woke up you saw doreman in you room .he has a tim.docx
IlonaThornburg83
 
DOCX
One afternoon at work, Natalie received a phone call from her daught.docx
IlonaThornburg83
 
DOCX
Once the United States got involved in World War I, what role did it.docx
IlonaThornburg83
 
DOCX
Once a Delinquent, Always a Delinquent  Please respond to the foll.docx
IlonaThornburg83
 
DOCX
On page 118 of your textbook is a picture of the sculpture Pietà by .docx
IlonaThornburg83
 
DOCX
Once a disease is thought to be caused by an infectious agent, a r.docx
IlonaThornburg83
 
DOCX
Once you have identified two questions that interest you, conduct an.docx
IlonaThornburg83
 
DOCX
On December 31, 2015, Ms. Levine CPA, your manager and the treasurer.docx
IlonaThornburg83
 
DOCX
On Dumpster Diving” by Lars Eighner (50 Essays, p. 139-15.docx
IlonaThornburg83
 
DOCX
Ok so I have done all the calculations, graphs and interpritations m.docx
IlonaThornburg83
 
DOCX
Ok so I know this is extreme short notice but I have a final 6 page .docx
IlonaThornburg83
 
DOCX
Offenses and Punishment. Please respond to the following Explai.docx
IlonaThornburg83
 
DOCX
Omit all general journal entry explanations.Be sure to include c.docx
IlonaThornburg83
 
DOCX
Offer an alternative explanation for how these patterns of criminal .docx
IlonaThornburg83
 
DOCX
Often, as a business operates, the partners bring some of their pers.docx
IlonaThornburg83
 
DOCX
Of all the GNR technologies (genetic engineering, nanotechnology and.docx
IlonaThornburg83
 
DOCX
Of the five management functions, which do you expect will experienc.docx
IlonaThornburg83
 
DOCX
Of the numerous forms of communication technologies presented in thi.docx
IlonaThornburg83
 
One aspect of epidemiology is the study of the epidemic, endemic, an.docx
IlonaThornburg83
 
Once you click the Assignment icon above, you will find links to Qui.docx
IlonaThornburg83
 
one day when you woke up you saw doreman in you room .he has a tim.docx
IlonaThornburg83
 
One afternoon at work, Natalie received a phone call from her daught.docx
IlonaThornburg83
 
Once the United States got involved in World War I, what role did it.docx
IlonaThornburg83
 
Once a Delinquent, Always a Delinquent  Please respond to the foll.docx
IlonaThornburg83
 
On page 118 of your textbook is a picture of the sculpture Pietà by .docx
IlonaThornburg83
 
Once a disease is thought to be caused by an infectious agent, a r.docx
IlonaThornburg83
 
Once you have identified two questions that interest you, conduct an.docx
IlonaThornburg83
 
On December 31, 2015, Ms. Levine CPA, your manager and the treasurer.docx
IlonaThornburg83
 
On Dumpster Diving” by Lars Eighner (50 Essays, p. 139-15.docx
IlonaThornburg83
 
Ok so I have done all the calculations, graphs and interpritations m.docx
IlonaThornburg83
 
Ok so I know this is extreme short notice but I have a final 6 page .docx
IlonaThornburg83
 
Offenses and Punishment. Please respond to the following Explai.docx
IlonaThornburg83
 
Omit all general journal entry explanations.Be sure to include c.docx
IlonaThornburg83
 
Offer an alternative explanation for how these patterns of criminal .docx
IlonaThornburg83
 
Often, as a business operates, the partners bring some of their pers.docx
IlonaThornburg83
 
Of all the GNR technologies (genetic engineering, nanotechnology and.docx
IlonaThornburg83
 
Of the five management functions, which do you expect will experienc.docx
IlonaThornburg83
 
Of the numerous forms of communication technologies presented in thi.docx
IlonaThornburg83
 
Ad

Recently uploaded (20)

DOCX
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
PPTX
How to Apply for a Job From Odoo 18 Website
Celine George
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PPTX
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
PPTX
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
PPTX
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
PPTX
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
DOCX
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
PDF
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTX
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
PPTX
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PDF
Virat Kohli- the Pride of Indian cricket
kushpar147
 
PDF
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
PDF
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
PPTX
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
How to Apply for a Job From Odoo 18 Website
Celine George
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
Virat Kohli- the Pride of Indian cricket
kushpar147
 
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 

ObjectiveTo acquire a comprehensive understanding of the applic.docx