Question: 1. Using the following rewrite rules for arithmetic expressions, draw a derivation tree for the expression 5*3+1+4 . expr expr add-op term | term term

1. Using the following rewrite rules for arithmetic expressions, draw a derivation tree for the expression 5*3+1+4.

expr expr add-op term | term
term term mult-op factor | factor
factor ( expr ) | digit-seq
add-op + | -
mult-op * | DIV | MOD
digit-seq digit digit-seq | digit
digit 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

2. Using the following rewrite rules for arithmetic expressions, draw a derivation tree for the expression 5*3+1+4.

expr term { add-op term }
term factor { mult-op factor }
factor ( expr ) | digit-seq
add-op + | -
mult-op * | DIV | MOD
digit-seq digit digit-seq | digit
digit 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!