Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

will upvote if the answer is correct 5. (20) Parsing Consider the CFG for in the slides (of L6) for parsing (Page 16), and an

will upvote if the answer is correct
image text in transcribed
5. (20) Parsing Consider the CFG for in the slides (of L6) for parsing (Page 16), and an input program sum := A + B write sum. (a) Trace the table driven parser as done in the class discussion. You can use a table for tracing as we did in L6 slides. (b) Trace the recursive descent parser (starting from the main function in P29 of L6 slides). You may write the function call sequences and changes of global variable input token) in executing the parser on the input program as shown below. If any function is missing, you can create your own following the problem decomposi- tion method we used during class. Note. To design the recursive descent parser, the best way is still the use of problem decomposition method following each pro- duction. This tracing just help you to see that it does work. program () | --stmt_list() // input_token: sum 1 ----stmt () // input_token: ? 1 ----stmt_list() // input_token: ? |--match($$) outputs true/false which is returned 5. (20) Parsing Consider the CFG for in the slides (of L6) for parsing (Page 16), and an input program sum := A + B write sum. (a) Trace the table driven parser as done in the class discussion. You can use a table for tracing as we did in L6 slides. (b) Trace the recursive descent parser (starting from the main function in P29 of L6 slides). You may write the function call sequences and changes of global variable input token) in executing the parser on the input program as shown below. If any function is missing, you can create your own following the problem decomposi- tion method we used during class. Note. To design the recursive descent parser, the best way is still the use of problem decomposition method following each pro- duction. This tracing just help you to see that it does work. program () | --stmt_list() // input_token: sum 1 ----stmt () // input_token: ? 1 ----stmt_list() // input_token: ? |--match($$) outputs true/false which is returned

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago