Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7718317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:08:17+00:00 2026-06-01T03:08:17+00:00

On page 29 it says The leaves of a parse tree read from left

  • 0

On page 29 it says “The leaves of a parse tree read from left to right form the yield of the tree, which is the string generated or derived from the nonterminal at the root of the parse tree. In Fig. 2.2 the generated string is 9-5*2. In that figure, all the leaves are shown at the bottom level. Henceforth, we shall not necessarily line up the leaves in this way.” why not?

It also says “Any tree imparts a natural left-to-right order to its leaves, based on the idea that if a and b are two children with the same parent, and a is to the left of b, then all descendants of a are to the left of descendants of b.” what does it mean?

P.S It’s the second edition of the book

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T03:08:19+00:00Added an answer on June 1, 2026 at 3:08 am

    So first of all, for anyone else wanting to comment on this, the page numbers above refer to the first edition. In the second edition, the page number is 46, and the diagram referred to is figure 2.5.

    EDIT: The author, when referring to extending the leaves down to the bottom, is talking about moving all leaves of the tree to be aligned vertically with each other, whether or not they are at the same level in the tree. Figure 2.2 has them extended to the bottom, such that every leaf is at the bottom of the diagram, aligned together vertically from left to right. If you look at some of the other diagrams later in the book, this is not done, and leaves are shown vertically aligned with other nodes at the same level, whether or not those other nodes are leaves. This latter way is the normal way of drawing trees, and is the most space efficient.

    As for your first question, I believe the reason they do not do that is to save room. If you look at the right hand side of figure 2.4, if the author was to extend the leaves down to the bottom, then the subtree with letter as its root would have to be moved to the right, taking up more room than what is actually needed. While this is a minimal case and doesn’t make a huge difference, one could imagine a larger tree (which I’m sure is in the book, although I didn’t go looking) which would need more room.

    For the second question, it is essentially saying that if you had a*b + c*d, and you considered the multiplications as siblings (as they would be to keep order of operations valid), then the leaves a and b would be to the left of c and d in the tree, just as they are to the left of c and d in the equation. Essentially its just saying what it already said in the first part, which is that the tree’s leaves should be able to be read left to right in order to reproduce the original syntax exactly, not switching the ordering of any portions (i.e. if the tree read left to right c*d + a*b, that might still be valid, but would not be a tree we are considering).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

expr manual page says: Pattern matches return the string matched between ( and )
The web page says Non-members may check out a read-only working copy anonymously over
This page says to use: var object = $.extend({}, object1, object2); But I prefer
If my page says: Code incorect please try again then my URL redirect should
salesforce plans page says that they charge per user. Well, it makes sense to
So here at the end of the page says a way to be able
Edit #2: i disabled my 404 page and the default not found page says
The MPI standard (page 295) says: Advice to users. Whether the errorcode is returned
I'm reading Javascript: the Definitive Reference , and it says on page 93: On
The Kdevelop wiki says (bottom of the page) *For cases where KDevelop is still

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.