{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

HM8-Ambiguity-NormalForms-Answers

HM8-Ambiguity-NormalForms-Answers - CS 341 Automata Theory...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 341 Automata Theory Elaine Rich Homework 8 Due: Thursday, March 8, 2007 This assignment covers Sections 11.7 - 11.8. 1) Let G be the ambiguous expression grammar of Example 11.14. Show at least three different parse trees that can be generated from G for the string id + id * id * id . 2) Consider the unambiguous expression grammar G of Example 11.19. a) Trace the derivation of the string id + id * id * id in G . E E + T T + T F + T id + T id + T F id + T F F id + F F F id + id F F id + id id F id + id id id b) Add exponentiation ( ) and unary minus (-) to G , assigning the highest precedence to unary minus, followed by exponentiation, multiplication, and addition, in that order. R = { E E + T E T T T F T F F F X F X X - X X Y Y ( E ) Y id }. 3) Let L = { w { a , b , , ε , (, ), *, + }* : w is a syntactically legal regular expression}. a) Write an unambiguous context-free grammar that generates L . Your grammar should have a structure similar to the arithmetic expression grammar G that we presented in Example 11.19.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern