compiler const assignment_3.docx - Assignment Three Dr Boniface Ngari Multimedia University of Kenya Assignment 3 1 Grammars for which predictive

compiler const assignment_3.docx - Assignment Three Dr...

This preview shows page 1 - 4 out of 5 pages.

Assignment Three Dr Boniface Ngari Multimedia University of Kenya
Image of page 1
Assignment 3. 1. Grammars for which predictive parsers can be created are known as LL (1). If a Language G is LL (1) grammar define it. A language is said to be LL (1) if it can be generated by a LL (1) grammar. It can be shown that LL (1) grammars are not ambiguous and not left-recursive. 2. Describe briefly the following parsing techniques. i) Top-Down Parsing The process of constructing the parse tree which starts from the root and goes down to the leaf is Top-Down Parsing. Top-Down Parsers constructs from the Grammar which is free from ambiguity and left recursion. Top Down Parsers uses leftmost derivation to construct a parse tree. It allows a grammar which is free from Left Factoring. ii) Bottom-Up Parsing Bottom-up parsing starts from the leaf nodes of a tree and works in upward direction till it reaches the root node. Here, we start from a sentence and then apply production rules in reverse manner in order to reach the start symbol. The image given below depicts the bottom-up parsers available.
Image of page 2
3.
Image of page 3
Image of page 4

You've reached the end of your free preview.

Want to read all 5 pages?

  • Fall '16
  • Kituku

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

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors