SlideShare a Scribd company logo

Problem 14 Consider the following grammar for postfix expressions. (T.pdf

Problem 14: Consider the following grammar for postfix expressions. (The symbol EMPTY in the grammar means that we produce an empty string.) Postfix ::= Number Postfix2 Postfix2 ::= Postfix BinOp Postfix2 | UnOp Postfix2 | EMPTY BinOp ::= '+' | '-' | '*' | '/' UnOp ::= 'neg' | 'sqrt' Number ::= any valid Java double Part (a Draw the parse tree (not the expression tree) for the expression "4 5 + sqrt 3 *" Part (b)Explain why the abstract syntax tree for the expression "4 5 + sqrt 3 *" is the same as it was for the previous problem, even though the grammar has changed. Part (c) Explain why you can write a recursive descent parser for this grammar. Part (d) Write the Java code for the getPostfix() and getPostfix2() methods that would implement a recognizing parser (assume the usual interface to the Tokenizer). private static void getPostfix(Tokenizer tokens) { }//getPostfix() private static void getPostfix2(Tokenizer tokens) { }//getPostfix2().

1 of 1
Download to read offline
Problem 14: Consider the following grammar for postfix expressions. (The symbol EMPTY in
the grammar means that we produce an empty string.) Postfix ::= Number Postfix2
Postfix2 ::= Postfix BinOp Postfix2 | UnOp Postfix2 | EMPTY BinOp ::=
'+' | '-' | '*' | '/' UnOp ::= 'neg' | 'sqrt' Number ::= any valid Java double Part (a Draw
the parse tree (not the expression tree) for the expression "4 5 + sqrt 3 *" Part (b)Explain why
the abstract syntax tree for the expression "4 5 + sqrt 3 *" is the same as it was for the previous
problem, even though the grammar has changed. Part (c) Explain why you can write a recursive
descent parser for this grammar. Part (d) Write the Java code for the getPostfix() and
getPostfix2() methods that would implement a recognizing parser (assume the usual interface to
the Tokenizer). private static void getPostfix(Tokenizer tokens) { }//getPostfix()
private static void getPostfix2(Tokenizer tokens) { }//getPostfix2()

Recommended

2nd Opinion The role of the preprocessor in the.pdf
2nd Opinion The role of the preprocessor in the.pdf2nd Opinion The role of the preprocessor in the.pdf
2nd Opinion The role of the preprocessor in the.pdfbkbk37
 
2nd Opinion The role of the preprocessor in the.pdf
2nd Opinion The role of the preprocessor in the.pdf2nd Opinion The role of the preprocessor in the.pdf
2nd Opinion The role of the preprocessor in the.pdfbkbk37
 
2nd Opinion The role of the preprocessor in the.pdf
2nd Opinion The role of the preprocessor in the.pdf2nd Opinion The role of the preprocessor in the.pdf
2nd Opinion The role of the preprocessor in the.pdfscottharry3
 
ForLoopandUserDefinedFunctions.pptx
ForLoopandUserDefinedFunctions.pptxForLoopandUserDefinedFunctions.pptx
ForLoopandUserDefinedFunctions.pptxAaliyanShaikh
 
Exploit techniques - a quick review
Exploit techniques - a quick reviewExploit techniques - a quick review
Exploit techniques - a quick reviewCe.Se.N.A. Security
 
First write the following expression in postfix (Reverse Polish) not.pdf
First write the following expression in postfix (Reverse Polish) not.pdfFirst write the following expression in postfix (Reverse Polish) not.pdf
First write the following expression in postfix (Reverse Polish) not.pdffatoryoutlets
 
Please provide a complete Python code with these provided co.pdf
Please provide a complete Python code with these provided co.pdfPlease provide a complete Python code with these provided co.pdf
Please provide a complete Python code with these provided co.pdfmukulsingh0025
 
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2PVS-Studio
 

More Related Content

Similar to Problem 14 Consider the following grammar for postfix expressions. (T.pdf

X86 assembly & GDB
X86 assembly & GDBX86 assembly & GDB
X86 assembly & GDBJian-Yu Li
 
C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)Saifur Rahman
 
Topic 2_revised.pptx
Topic 2_revised.pptxTopic 2_revised.pptx
Topic 2_revised.pptxJAYAPRIYAR7
 
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxConsider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxmaxinesmith73660
 
Berkeley Packet Filters
Berkeley Packet FiltersBerkeley Packet Filters
Berkeley Packet FiltersKernel TLV
 
Advanced Debugging Using Java Bytecodes
Advanced Debugging Using Java BytecodesAdvanced Debugging Using Java Bytecodes
Advanced Debugging Using Java BytecodesGanesh Samarthyam
 
Reverse Engineering Dojo: Enhancing Assembly Reading Skills
Reverse Engineering Dojo: Enhancing Assembly Reading SkillsReverse Engineering Dojo: Enhancing Assembly Reading Skills
Reverse Engineering Dojo: Enhancing Assembly Reading SkillsAsuka Nakajima
 
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
 
Advanced procedures in assembly language Full chapter ppt
Advanced procedures in assembly language Full chapter pptAdvanced procedures in assembly language Full chapter ppt
Advanced procedures in assembly language Full chapter pptMuhammad Sikandar Mustafa
 

Similar to Problem 14 Consider the following grammar for postfix expressions. (T.pdf (20)

X86 assembly & GDB
X86 assembly & GDBX86 assembly & GDB
X86 assembly & GDB
 
C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)
 
Topic 2_revised.pptx
Topic 2_revised.pptxTopic 2_revised.pptx
Topic 2_revised.pptx
 
Programming Assignment Help
Programming Assignment HelpProgramming Assignment Help
Programming Assignment Help
 
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxConsider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
 
OpenMP
OpenMPOpenMP
OpenMP
 
6th Semester (Dec-2015; Jan-2016) Computer Science and Information Science En...
6th Semester (Dec-2015; Jan-2016) Computer Science and Information Science En...6th Semester (Dec-2015; Jan-2016) Computer Science and Information Science En...
6th Semester (Dec-2015; Jan-2016) Computer Science and Information Science En...
 
Berkeley Packet Filters
Berkeley Packet FiltersBerkeley Packet Filters
Berkeley Packet Filters
 
Computer Network Assignment Help
Computer Network Assignment HelpComputer Network Assignment Help
Computer Network Assignment Help
 
Adobe
AdobeAdobe
Adobe
 
The Stack and Buffer Overflows
The Stack and Buffer OverflowsThe Stack and Buffer Overflows
The Stack and Buffer Overflows
 
5th semester Computer Science and Information Science Engg (2013 December) Qu...
5th semester Computer Science and Information Science Engg (2013 December) Qu...5th semester Computer Science and Information Science Engg (2013 December) Qu...
5th semester Computer Science and Information Science Engg (2013 December) Qu...
 
Faster Python, FOSDEM
Faster Python, FOSDEMFaster Python, FOSDEM
Faster Python, FOSDEM
 
Advanced Debugging Using Java Bytecodes
Advanced Debugging Using Java BytecodesAdvanced Debugging Using Java Bytecodes
Advanced Debugging Using Java Bytecodes
 
Shell Script Tutorial
Shell Script TutorialShell Script Tutorial
Shell Script Tutorial
 
Reverse Engineering Dojo: Enhancing Assembly Reading Skills
Reverse Engineering Dojo: Enhancing Assembly Reading SkillsReverse Engineering Dojo: Enhancing Assembly Reading Skills
Reverse Engineering Dojo: Enhancing Assembly Reading Skills
 
Exploitation Crash Course
Exploitation Crash CourseExploitation Crash Course
Exploitation Crash Course
 
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
 
cp05.pptx
cp05.pptxcp05.pptx
cp05.pptx
 
Advanced procedures in assembly language Full chapter ppt
Advanced procedures in assembly language Full chapter pptAdvanced procedures in assembly language Full chapter ppt
Advanced procedures in assembly language Full chapter ppt
 

More from kishorchelani123

Problem 9Find the space functionequation, $S(n)$, of prob8 (d.pdf
Problem 9Find the space functionequation, $S(n)$, of prob8 (d.pdfProblem 9Find the space functionequation, $S(n)$, of prob8 (d.pdf
Problem 9Find the space functionequation, $S(n)$, of prob8 (d.pdfkishorchelani123
 
Problem 9-11 (Algo)Assume that Product Z is made of two units of A.pdf
Problem 9-11 (Algo)Assume that Product Z is made of two units of A.pdfProblem 9-11 (Algo)Assume that Product Z is made of two units of A.pdf
Problem 9-11 (Algo)Assume that Product Z is made of two units of A.pdfkishorchelani123
 
Problem2) BAM, Inc. completed its first year of operations with a pr.pdf
Problem2) BAM, Inc. completed its first year of operations with a pr.pdfProblem2) BAM, Inc. completed its first year of operations with a pr.pdf
Problem2) BAM, Inc. completed its first year of operations with a pr.pdfkishorchelani123
 
Problema 1 Su empresa fabrica m�scaras faciales y est� preocupad.pdf
Problema 1 Su empresa fabrica m�scaras faciales y est� preocupad.pdfProblema 1 Su empresa fabrica m�scaras faciales y est� preocupad.pdf
Problema 1 Su empresa fabrica m�scaras faciales y est� preocupad.pdfkishorchelani123
 
Problem 7-49 (Static) Applying Overhead Using a Predetermined Rate (.pdf
Problem 7-49 (Static) Applying Overhead Using a Predetermined Rate (.pdfProblem 7-49 (Static) Applying Overhead Using a Predetermined Rate (.pdf
Problem 7-49 (Static) Applying Overhead Using a Predetermined Rate (.pdfkishorchelani123
 
Problem 6 (Chapter 9 Material) 11 points possibleYou want to.pdf
Problem 6 (Chapter 9 Material)  11 points possibleYou want to.pdfProblem 6 (Chapter 9 Material)  11 points possibleYou want to.pdf
Problem 6 (Chapter 9 Material) 11 points possibleYou want to.pdfkishorchelani123
 
Problema 1. Valor Presente Neto. Eres gerente de un gimnasio. Seg�n .pdf
Problema 1. Valor Presente Neto. Eres gerente de un gimnasio. Seg�n .pdfProblema 1. Valor Presente Neto. Eres gerente de un gimnasio. Seg�n .pdf
Problema 1. Valor Presente Neto. Eres gerente de un gimnasio. Seg�n .pdfkishorchelani123
 
Problema #2 M�todos de depreciaci�n (MUESTRE SU TRABAJO) Numo Com.pdf
Problema #2 M�todos de depreciaci�n (MUESTRE SU TRABAJO) Numo Com.pdfProblema #2 M�todos de depreciaci�n (MUESTRE SU TRABAJO) Numo Com.pdf
Problema #2 M�todos de depreciaci�n (MUESTRE SU TRABAJO) Numo Com.pdfkishorchelani123
 
Problem Suppose we already have the following E-R diagram for Gran.pdf
Problem Suppose we already have the following E-R diagram for Gran.pdfProblem Suppose we already have the following E-R diagram for Gran.pdf
Problem Suppose we already have the following E-R diagram for Gran.pdfkishorchelani123
 
Problem 7) Zeena incorporated her sole proprietorship by transferr.pdf
Problem 7) Zeena incorporated her sole proprietorship by transferr.pdfProblem 7) Zeena incorporated her sole proprietorship by transferr.pdf
Problem 7) Zeena incorporated her sole proprietorship by transferr.pdfkishorchelani123
 
problem 5 Let T be a binary tree with n nodes, and let f() be the l.pdf
problem 5  Let T be a binary tree with n nodes, and let f() be the l.pdfproblem 5  Let T be a binary tree with n nodes, and let f() be the l.pdf
problem 5 Let T be a binary tree with n nodes, and let f() be the l.pdfkishorchelani123
 
Problem 6) Archie and Reggie agree to go into business together sell.pdf
Problem 6) Archie and Reggie agree to go into business together sell.pdfProblem 6) Archie and Reggie agree to go into business together sell.pdf
Problem 6) Archie and Reggie agree to go into business together sell.pdfkishorchelani123
 
Problem 6 (30 points)Go to the FRED website, httpsfred.stlouisf.pdf
Problem 6 (30 points)Go to the FRED website, httpsfred.stlouisf.pdfProblem 6 (30 points)Go to the FRED website, httpsfred.stlouisf.pdf
Problem 6 (30 points)Go to the FRED website, httpsfred.stlouisf.pdfkishorchelani123
 
Problem 5) Let T be a binary tree with n nodes, and let f() be the l.pdf
Problem 5) Let T be a binary tree with n nodes, and let f() be the l.pdfProblem 5) Let T be a binary tree with n nodes, and let f() be the l.pdf
Problem 5) Let T be a binary tree with n nodes, and let f() be the l.pdfkishorchelani123
 
Problem 3Jackson Company exchanged land and cash of $7,500 for equ.pdf
Problem 3Jackson Company exchanged land and cash of $7,500 for equ.pdfProblem 3Jackson Company exchanged land and cash of $7,500 for equ.pdf
Problem 3Jackson Company exchanged land and cash of $7,500 for equ.pdfkishorchelani123
 
Problem 3. (36 points) Managing and Estimating Delays. AUzon�s custo.pdf
Problem 3. (36 points) Managing and Estimating Delays. AUzon�s custo.pdfProblem 3. (36 points) Managing and Estimating Delays. AUzon�s custo.pdf
Problem 3. (36 points) Managing and Estimating Delays. AUzon�s custo.pdfkishorchelani123
 
Problem 3 (20 points) Most developed economies have grown substant.pdf
Problem 3 (20 points) Most developed economies have grown substant.pdfProblem 3 (20 points) Most developed economies have grown substant.pdf
Problem 3 (20 points) Most developed economies have grown substant.pdfkishorchelani123
 
Problem 21-16 (Algo) One unit of A is composed of two units of B and.pdf
Problem 21-16 (Algo) One unit of A is composed of two units of B and.pdfProblem 21-16 (Algo) One unit of A is composed of two units of B and.pdf
Problem 21-16 (Algo) One unit of A is composed of two units of B and.pdfkishorchelani123
 
Problem 2. Pacman is an agent in a deterministic MDP with states A, .pdf
Problem 2. Pacman is an agent in a deterministic MDP with states A, .pdfProblem 2. Pacman is an agent in a deterministic MDP with states A, .pdf
Problem 2. Pacman is an agent in a deterministic MDP with states A, .pdfkishorchelani123
 
Problem 2. (Keygen Program) Write a program called keygen.py that ac.pdf
Problem 2. (Keygen Program) Write a program called keygen.py that ac.pdfProblem 2. (Keygen Program) Write a program called keygen.py that ac.pdf
Problem 2. (Keygen Program) Write a program called keygen.py that ac.pdfkishorchelani123
 

More from kishorchelani123 (20)

Problem 9Find the space functionequation, $S(n)$, of prob8 (d.pdf
Problem 9Find the space functionequation, $S(n)$, of prob8 (d.pdfProblem 9Find the space functionequation, $S(n)$, of prob8 (d.pdf
Problem 9Find the space functionequation, $S(n)$, of prob8 (d.pdf
 
Problem 9-11 (Algo)Assume that Product Z is made of two units of A.pdf
Problem 9-11 (Algo)Assume that Product Z is made of two units of A.pdfProblem 9-11 (Algo)Assume that Product Z is made of two units of A.pdf
Problem 9-11 (Algo)Assume that Product Z is made of two units of A.pdf
 
Problem2) BAM, Inc. completed its first year of operations with a pr.pdf
Problem2) BAM, Inc. completed its first year of operations with a pr.pdfProblem2) BAM, Inc. completed its first year of operations with a pr.pdf
Problem2) BAM, Inc. completed its first year of operations with a pr.pdf
 
Problema 1 Su empresa fabrica m�scaras faciales y est� preocupad.pdf
Problema 1 Su empresa fabrica m�scaras faciales y est� preocupad.pdfProblema 1 Su empresa fabrica m�scaras faciales y est� preocupad.pdf
Problema 1 Su empresa fabrica m�scaras faciales y est� preocupad.pdf
 
Problem 7-49 (Static) Applying Overhead Using a Predetermined Rate (.pdf
Problem 7-49 (Static) Applying Overhead Using a Predetermined Rate (.pdfProblem 7-49 (Static) Applying Overhead Using a Predetermined Rate (.pdf
Problem 7-49 (Static) Applying Overhead Using a Predetermined Rate (.pdf
 
Problem 6 (Chapter 9 Material) 11 points possibleYou want to.pdf
Problem 6 (Chapter 9 Material)  11 points possibleYou want to.pdfProblem 6 (Chapter 9 Material)  11 points possibleYou want to.pdf
Problem 6 (Chapter 9 Material) 11 points possibleYou want to.pdf
 
Problema 1. Valor Presente Neto. Eres gerente de un gimnasio. Seg�n .pdf
Problema 1. Valor Presente Neto. Eres gerente de un gimnasio. Seg�n .pdfProblema 1. Valor Presente Neto. Eres gerente de un gimnasio. Seg�n .pdf
Problema 1. Valor Presente Neto. Eres gerente de un gimnasio. Seg�n .pdf
 
Problema #2 M�todos de depreciaci�n (MUESTRE SU TRABAJO) Numo Com.pdf
Problema #2 M�todos de depreciaci�n (MUESTRE SU TRABAJO) Numo Com.pdfProblema #2 M�todos de depreciaci�n (MUESTRE SU TRABAJO) Numo Com.pdf
Problema #2 M�todos de depreciaci�n (MUESTRE SU TRABAJO) Numo Com.pdf
 
Problem Suppose we already have the following E-R diagram for Gran.pdf
Problem Suppose we already have the following E-R diagram for Gran.pdfProblem Suppose we already have the following E-R diagram for Gran.pdf
Problem Suppose we already have the following E-R diagram for Gran.pdf
 
Problem 7) Zeena incorporated her sole proprietorship by transferr.pdf
Problem 7) Zeena incorporated her sole proprietorship by transferr.pdfProblem 7) Zeena incorporated her sole proprietorship by transferr.pdf
Problem 7) Zeena incorporated her sole proprietorship by transferr.pdf
 
problem 5 Let T be a binary tree with n nodes, and let f() be the l.pdf
problem 5  Let T be a binary tree with n nodes, and let f() be the l.pdfproblem 5  Let T be a binary tree with n nodes, and let f() be the l.pdf
problem 5 Let T be a binary tree with n nodes, and let f() be the l.pdf
 
Problem 6) Archie and Reggie agree to go into business together sell.pdf
Problem 6) Archie and Reggie agree to go into business together sell.pdfProblem 6) Archie and Reggie agree to go into business together sell.pdf
Problem 6) Archie and Reggie agree to go into business together sell.pdf
 
Problem 6 (30 points)Go to the FRED website, httpsfred.stlouisf.pdf
Problem 6 (30 points)Go to the FRED website, httpsfred.stlouisf.pdfProblem 6 (30 points)Go to the FRED website, httpsfred.stlouisf.pdf
Problem 6 (30 points)Go to the FRED website, httpsfred.stlouisf.pdf
 
Problem 5) Let T be a binary tree with n nodes, and let f() be the l.pdf
Problem 5) Let T be a binary tree with n nodes, and let f() be the l.pdfProblem 5) Let T be a binary tree with n nodes, and let f() be the l.pdf
Problem 5) Let T be a binary tree with n nodes, and let f() be the l.pdf
 
Problem 3Jackson Company exchanged land and cash of $7,500 for equ.pdf
Problem 3Jackson Company exchanged land and cash of $7,500 for equ.pdfProblem 3Jackson Company exchanged land and cash of $7,500 for equ.pdf
Problem 3Jackson Company exchanged land and cash of $7,500 for equ.pdf
 
Problem 3. (36 points) Managing and Estimating Delays. AUzon�s custo.pdf
Problem 3. (36 points) Managing and Estimating Delays. AUzon�s custo.pdfProblem 3. (36 points) Managing and Estimating Delays. AUzon�s custo.pdf
Problem 3. (36 points) Managing and Estimating Delays. AUzon�s custo.pdf
 
Problem 3 (20 points) Most developed economies have grown substant.pdf
Problem 3 (20 points) Most developed economies have grown substant.pdfProblem 3 (20 points) Most developed economies have grown substant.pdf
Problem 3 (20 points) Most developed economies have grown substant.pdf
 
Problem 21-16 (Algo) One unit of A is composed of two units of B and.pdf
Problem 21-16 (Algo) One unit of A is composed of two units of B and.pdfProblem 21-16 (Algo) One unit of A is composed of two units of B and.pdf
Problem 21-16 (Algo) One unit of A is composed of two units of B and.pdf
 
Problem 2. Pacman is an agent in a deterministic MDP with states A, .pdf
Problem 2. Pacman is an agent in a deterministic MDP with states A, .pdfProblem 2. Pacman is an agent in a deterministic MDP with states A, .pdf
Problem 2. Pacman is an agent in a deterministic MDP with states A, .pdf
 
Problem 2. (Keygen Program) Write a program called keygen.py that ac.pdf
Problem 2. (Keygen Program) Write a program called keygen.py that ac.pdfProblem 2. (Keygen Program) Write a program called keygen.py that ac.pdf
Problem 2. (Keygen Program) Write a program called keygen.py that ac.pdf
 

Recently uploaded

CONCEPTS OF ENVIRONMENT & ECOSYSTEM.pptx
CONCEPTS OF ENVIRONMENT & ECOSYSTEM.pptxCONCEPTS OF ENVIRONMENT & ECOSYSTEM.pptx
CONCEPTS OF ENVIRONMENT & ECOSYSTEM.pptxAnupkumar Sharma
 
Intuition behind Monte Carlo Markov Chains
Intuition behind Monte Carlo Markov ChainsIntuition behind Monte Carlo Markov Chains
Intuition behind Monte Carlo Markov ChainsTushar Tank
 
ICSE English Literature Class X Handwritten Notes
ICSE English Literature Class X Handwritten NotesICSE English Literature Class X Handwritten Notes
ICSE English Literature Class X Handwritten NotesGauri S
 
ACTIVIDAD DE CLASE No 1 sopa de letras.docx
ACTIVIDAD DE CLASE No 1 sopa de letras.docxACTIVIDAD DE CLASE No 1 sopa de letras.docx
ACTIVIDAD DE CLASE No 1 sopa de letras.docxMaria Lucia Céspedes
 
The Ministry of Utmost Happiness by Arundhati Roy
The Ministry of Utmost Happiness by Arundhati RoyThe Ministry of Utmost Happiness by Arundhati Roy
The Ministry of Utmost Happiness by Arundhati RoyTrushali Dodiya
 
Evaluation and management of patients with Dyspepsia.pptx
Evaluation and management of patients with Dyspepsia.pptxEvaluation and management of patients with Dyspepsia.pptx
Evaluation and management of patients with Dyspepsia.pptxgarvitnanecha
 
Chromatography-Gas chromatography-Principle
Chromatography-Gas chromatography-PrincipleChromatography-Gas chromatography-Principle
Chromatography-Gas chromatography-Principleblessipriyanka
 
Overview of Databases and Data Modelling-1.pdf
Overview of Databases and Data Modelling-1.pdfOverview of Databases and Data Modelling-1.pdf
Overview of Databases and Data Modelling-1.pdfChristalin Nelson
 
DISCOURSE: TEXT AS CONNECTED DISCOURSE
DISCOURSE:   TEXT AS CONNECTED DISCOURSEDISCOURSE:   TEXT AS CONNECTED DISCOURSE
DISCOURSE: TEXT AS CONNECTED DISCOURSEMYDA ANGELICA SUAN
 
UniSC Moreton Bay Library self-guided tour
UniSC Moreton Bay Library self-guided tourUniSC Moreton Bay Library self-guided tour
UniSC Moreton Bay Library self-guided tourUSC_Library
 
Practical Research 1: Qualitative Research and Its Importance in Daily Life.pptx
Practical Research 1: Qualitative Research and Its Importance in Daily Life.pptxPractical Research 1: Qualitative Research and Its Importance in Daily Life.pptx
Practical Research 1: Qualitative Research and Its Importance in Daily Life.pptxKatherine Villaluna
 
Bayesian Analysis Fundamentals with Examples
Bayesian Analysis Fundamentals with ExamplesBayesian Analysis Fundamentals with Examples
Bayesian Analysis Fundamentals with ExamplesTushar Tank
 
Data Modeling - Entity Relationship Diagrams-1.pdf
Data Modeling - Entity Relationship Diagrams-1.pdfData Modeling - Entity Relationship Diagrams-1.pdf
Data Modeling - Entity Relationship Diagrams-1.pdfChristalin Nelson
 
Appendicular SkeletonSystem PPT.....pptx
Appendicular SkeletonSystem PPT.....pptxAppendicular SkeletonSystem PPT.....pptx
Appendicular SkeletonSystem PPT.....pptxRenuka N Sunagad
 
2.20.24 The March on Washington for Jobs and Freedom.pptx
2.20.24 The March on Washington for Jobs and Freedom.pptx2.20.24 The March on Washington for Jobs and Freedom.pptx
2.20.24 The March on Washington for Jobs and Freedom.pptxMaryPotorti1
 
UniSC Fraser Coast library self-guided tour
UniSC Fraser Coast library self-guided tourUniSC Fraser Coast library self-guided tour
UniSC Fraser Coast library self-guided tourUSC_Library
 

Recently uploaded (20)

Time-Honored Wisdom: African Teachings for VUCA Leaders
Time-Honored Wisdom: African Teachings for VUCA LeadersTime-Honored Wisdom: African Teachings for VUCA Leaders
Time-Honored Wisdom: African Teachings for VUCA Leaders
 
CONCEPTS OF ENVIRONMENT & ECOSYSTEM.pptx
CONCEPTS OF ENVIRONMENT & ECOSYSTEM.pptxCONCEPTS OF ENVIRONMENT & ECOSYSTEM.pptx
CONCEPTS OF ENVIRONMENT & ECOSYSTEM.pptx
 
Capter 5 Climate of Ethiopia and the Horn GeES 1011.pdf
Capter 5 Climate of Ethiopia and the Horn GeES 1011.pdfCapter 5 Climate of Ethiopia and the Horn GeES 1011.pdf
Capter 5 Climate of Ethiopia and the Horn GeES 1011.pdf
 
Intuition behind Monte Carlo Markov Chains
Intuition behind Monte Carlo Markov ChainsIntuition behind Monte Carlo Markov Chains
Intuition behind Monte Carlo Markov Chains
 
ICSE English Literature Class X Handwritten Notes
ICSE English Literature Class X Handwritten NotesICSE English Literature Class X Handwritten Notes
ICSE English Literature Class X Handwritten Notes
 
ACTIVIDAD DE CLASE No 1 sopa de letras.docx
ACTIVIDAD DE CLASE No 1 sopa de letras.docxACTIVIDAD DE CLASE No 1 sopa de letras.docx
ACTIVIDAD DE CLASE No 1 sopa de letras.docx
 
The Ministry of Utmost Happiness by Arundhati Roy
The Ministry of Utmost Happiness by Arundhati RoyThe Ministry of Utmost Happiness by Arundhati Roy
The Ministry of Utmost Happiness by Arundhati Roy
 
Evaluation and management of patients with Dyspepsia.pptx
Evaluation and management of patients with Dyspepsia.pptxEvaluation and management of patients with Dyspepsia.pptx
Evaluation and management of patients with Dyspepsia.pptx
 
first section physiology laboratory.pptx
first section physiology laboratory.pptxfirst section physiology laboratory.pptx
first section physiology laboratory.pptx
 
Chromatography-Gas chromatography-Principle
Chromatography-Gas chromatography-PrincipleChromatography-Gas chromatography-Principle
Chromatography-Gas chromatography-Principle
 
Lipids as Biopolymer
Lipids as Biopolymer Lipids as Biopolymer
Lipids as Biopolymer
 
Overview of Databases and Data Modelling-1.pdf
Overview of Databases and Data Modelling-1.pdfOverview of Databases and Data Modelling-1.pdf
Overview of Databases and Data Modelling-1.pdf
 
DISCOURSE: TEXT AS CONNECTED DISCOURSE
DISCOURSE:   TEXT AS CONNECTED DISCOURSEDISCOURSE:   TEXT AS CONNECTED DISCOURSE
DISCOURSE: TEXT AS CONNECTED DISCOURSE
 
UniSC Moreton Bay Library self-guided tour
UniSC Moreton Bay Library self-guided tourUniSC Moreton Bay Library self-guided tour
UniSC Moreton Bay Library self-guided tour
 
Practical Research 1: Qualitative Research and Its Importance in Daily Life.pptx
Practical Research 1: Qualitative Research and Its Importance in Daily Life.pptxPractical Research 1: Qualitative Research and Its Importance in Daily Life.pptx
Practical Research 1: Qualitative Research and Its Importance in Daily Life.pptx
 
Bayesian Analysis Fundamentals with Examples
Bayesian Analysis Fundamentals with ExamplesBayesian Analysis Fundamentals with Examples
Bayesian Analysis Fundamentals with Examples
 
Data Modeling - Entity Relationship Diagrams-1.pdf
Data Modeling - Entity Relationship Diagrams-1.pdfData Modeling - Entity Relationship Diagrams-1.pdf
Data Modeling - Entity Relationship Diagrams-1.pdf
 
Appendicular SkeletonSystem PPT.....pptx
Appendicular SkeletonSystem PPT.....pptxAppendicular SkeletonSystem PPT.....pptx
Appendicular SkeletonSystem PPT.....pptx
 
2.20.24 The March on Washington for Jobs and Freedom.pptx
2.20.24 The March on Washington for Jobs and Freedom.pptx2.20.24 The March on Washington for Jobs and Freedom.pptx
2.20.24 The March on Washington for Jobs and Freedom.pptx
 
UniSC Fraser Coast library self-guided tour
UniSC Fraser Coast library self-guided tourUniSC Fraser Coast library self-guided tour
UniSC Fraser Coast library self-guided tour
 

Problem 14 Consider the following grammar for postfix expressions. (T.pdf

  • 1. Problem 14: Consider the following grammar for postfix expressions. (The symbol EMPTY in the grammar means that we produce an empty string.) Postfix ::= Number Postfix2 Postfix2 ::= Postfix BinOp Postfix2 | UnOp Postfix2 | EMPTY BinOp ::= '+' | '-' | '*' | '/' UnOp ::= 'neg' | 'sqrt' Number ::= any valid Java double Part (a Draw the parse tree (not the expression tree) for the expression "4 5 + sqrt 3 *" Part (b)Explain why the abstract syntax tree for the expression "4 5 + sqrt 3 *" is the same as it was for the previous problem, even though the grammar has changed. Part (c) Explain why you can write a recursive descent parser for this grammar. Part (d) Write the Java code for the getPostfix() and getPostfix2() methods that would implement a recognizing parser (assume the usual interface to the Tokenizer). private static void getPostfix(Tokenizer tokens) { }//getPostfix() private static void getPostfix2(Tokenizer tokens) { }//getPostfix2()