{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Count a n count c n count a n count a n a a n count 1

Info icon This preview shows pages 3–4. Sign up to view the full content.

View Full Document Right Arrow Icon
> . count < a-n > . count < c-n > . count < a-n > . count < a-n > ::= a < a-n > . count 1 | < a-n > 1 a < a-n > . count < a-n > 1 . count + 1 < b-n > ::= b Condition: < b-n > . count = 1 | < b-n > 1 b < b-n > 1 . count < b-n > . count - 1 < c-n > ::= c Condition: < c-n > . count = 1 | < c-n > 1 c < c-n > 1 . count < c-n > . count - 1 (a) Indicate which attributes are inherited, which are synthesized, and which are intrinsic. inherited - count of <b-n> and <c-n> synthesized - count of <a-n> intrinsic - none (b) Draw the attributed parse tree for the string “aaabbbccc”, showing clearly the order of evaluation of all attributes.
Image of page 3

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

View Full Document Right Arrow Icon
<string> / | \ / | \ / | \ / | \ / | \ / | \ / | \ / | \ / | \ / | \ / | \ / | \ / | \ / | \ / | \ / | \ / | \ / | \ / | \ / | \ <a-n> <b-n> <c-n> 3) count: 3 4) count: 3 5) count: 3 /\ /\ /\ / \ / \ / \ / \ / \ / \ / \ / \ / \ <a-n> a <b-n> b <c-n> c 2) count: 2 6) count: 2 9) count: 2 /\ /\ /\ / \ / \ / \ / \ / \ / \ / \ / \ / \ <a-n> a <b-n> b <c-n> c 1) count: 1 7) count: 1 10) count: 1 | 8) Condition: true 11) Condition: true | | | | | | a b c
Image of page 4
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