. Question 1. Given the following grammar S → aAb | bBA A → ab | aAB B → aB | b and for each of the following right sentential forms, draw a parse tree and show the phrases, simple phrases and the handle. (15pt) (a) aaAbb (b) bBab (c) aaAbB b

Respuesta :

Answer:

Explanation:

(a) aaAbb (b) bBab (c) aaAbB b

The parse tree and phases are shown in the attached diagram below

Ver imagen mudamoon97

Answer:

Explanation

The following question refer to the grammar below,

S --> aAb | bBA

A --> ab | aAB

B --> aB |b

A) aaAbb

Parse Tree for question A

S

/ | \

a A b

/|\

a A B

|

b

Handles: b, aAB

Phrases: aaAbb, aaABb, aAb

Simple Phrase: b

B) bBab

PARSE TREE for question B.

S

/ | \

b B A

/ \

a b

Handles: ab

Phrases: bBab, bBA

Simple Phrase: ab

C) simple phrases:ab

Handle:ab

Phrases:aaaBb,aabB,ab

PARSE TREE for question C.

S

/ | \

a A b

/|\

a A b

/ \

a b