Question: Draw the Abstract Syntax Parse Tree for each of sentences from Exercise 2.5 (a, b, & c), using the abstract syntax for Assignment given in

 Draw the Abstract Syntax Parse Tree for each of sentences from

Draw the Abstract Syntax Parse Tree for each of sentences from Exercise 2.5 (a, b, & c), using the abstract syntax for Assignment given in Figure 2.7. Could convert to BNF as shown below EBNF BNF (converted) Assignment--> Identifier [ [Expression]-Expression Expression=> Conjunction { Il conjunction } Conjunction>Eqality&& Equality Equality>Relation [ EquOp Relation ] => RO Add empty Exp => Con Con =>Equ Relation>Addition [RelOp Addition Re-> Add Addition :-> Term . AddOp Term } F>MO Fempty Term = Factor { MuIOp Factor) MulOp--> * 1 / 1 % Factor>UnaryOp] Primary Primary ==> ldentifier [ [Expression)) | Literal l (Expression) Type (Expression) identifier ==> Letter ( Letter | Digit) Letter=-> a l b l l z IA I B I I z Digit >0 19 Literal>Integer Boolean | Float Char InteregerDigit Digit Figure 2.7 Syntax of Clite

=> D

I empty 1 Using the grammar above (Figure 2.7), Abstract Parse Trees for each of the following (a) x = x + a-1; (b) a b*c/d; (c)I-j*k -3

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!