Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 Syntax trees Consider the following grammar with terminals: number, +, , (, and ). expr ::= expr + expr | expr expr | (expr

1 Syntax trees

Consider the following grammar with terminals: number, +, , (, and ).

expr ::= expr + expr | expr expr | (expr ) | number

number = [0-9]+

1. We can derive the expression 78 20 + 5 39 as follows (among many other derivations).

expr expr expr expr + expr expr expr expr + expr expr number expr + expr expr 78 expr + expr expr 78 expr + number expr 78 expr + 5 expr 78 expr + 5 number 78 expr + 5 39 78 number + 5 39 78 20 + 5 39

Give the parse tree that represents this derivation. Lets call your parse tree P1.

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

PostgreSQL Up And Running A Practical Guide To The Advanced Open Source Database

Authors: Regina Obe, Leo Hsu

3rd Edition

1491963417, 978-1491963418

More Books

Students also viewed these Databases questions