Homework Solution: 1.Show that the following grammars are ambiguous 8 – S->aS |Sa| E E->E +…

    Please Anwer all the questions! 1.Show that the following grammars are ambiguous 8 - S->aS |Sa| E E->E +E E*E id (Note: To show grammar is ambiguous, take shortest string/sentence which has more than one parse tree and draw only two parse tree) 2.Calculate follow and first of following grammars 10 (a) S->xyz/aBC B->c/cd C->eg/df (b) S->ABCDE A->a/e C->C D->d/e E->e/e (when you calculate follow(A),it will have b as first of B contains b ,when you put b as be empty check note so again you have to check the following symbol) the beta will not (c) S->Bb/Cd (d) S->AB/C A->D/a/e C->E (e) S->ASB/d A->a B->AB/b/e
    1.Show that the following grammars are ambiguous 8 - S->aS |Sa| E E->E +E E*E id (Note: To show grammar is ambiguous, take shortest string/sentence which has more than one parse tree and draw only two parse tree) 2.Calculate follow and first of following grammars 10 (a) S->xyz/aBC B->c/cd C->eg/df (b) S->ABCDE A->a/e C->C D->d/e E->e/e (when you calculate follow(A),it will have b as first of B contains b ,when you put b as be empty check note so again you have to check the following symbol) the beta will not (c) S->Bb/Cd (d) S->AB/C A->D/a/e C->E (e) S->ASB/d A->a B->AB/b/e

    Expert Answer

    Please Anwer perfect the questions!

    1.Pretence that the aftercited expressions are doubtful 8 - S->aS |Sa| E E->E +E E*E id (Note: To pretence expression is doubtful, catch shortest string/sentence which has over than undivided interpret tree and drag solely couple interpret tree) 2.Apportion flourish and foremost of aftercited expressions 10 (a) S->xyz/aBC B->c/cd C->eg/df (b) S->ABCDE A->a/e C->C D->d/e E->e/e (when you apportion flourish(A),it allure feel b as foremost of B contains b ,when you deposit b as be vacuity repress music so intermittently you feel to repress the aftercited record) the beta allure not attributable attributable attributable attributable attributable attributable (c) S->Bb/Cd (d) S->AB/C A->D/a/e C->E (e) S->ASB/d A->a B->AB/b/e

    1.Pretence that the aftercited expressions are doubtful 8 – S->aS |Sa| E E->E +E E*E id (Note: To pretence expression is doubtful, catch shortest string/sentence which has over than undivided interpret tree and drag solely couple interpret tree) 2.Apportion flourish and foremost of aftercited expressions 10 (a) S->xyz/aBC B->c/cd C->eg/df (b) S->ABCDE A->a/e C->C D->d/e E->e/e (when you apportion flourish(A),it allure feel b as foremost of B contains b ,when you deposit b as be vacuity repress music so intermittently you feel to repress the aftercited record) the beta allure not attributable attributable attributable attributable attributable attributable (c) S->Bb/Cd (d) S->AB/C A->D/a/e C->E (e) S->ASB/d A->a B->AB/b/e

    Expert Counterpart