0
$\begingroup$

I have come across the following question in an exam:

Can inherited attributes be evaluated in bottom-up parsing?

My approach went like this:

Inherited attributes can never be evaluated in bottom-up parsing because the parent node is not constructed during parse yet when we visit the child node. In order to evaluate an inherited attribute of child node we may need the value of parent nodes attributes hence we cannot get the parent nodes attributes as its not yet created hence we can not evaluate the child nodes inherited attributes.

Is my approach wrong? Am I conceptually missing anything?

$\endgroup$
  • $\begingroup$ @Discretelizard sir i have edited the question please have a look $\endgroup$ – venkat Jan 14 '18 at 17:04
  • $\begingroup$ We discourage "please check whether my answer is correct" questions, as only "yes/no" answers are possible, which won't help you or future visitors. See here and here. Can you edit your post to ask about a specific conceptual issue you're uncertain about? As a rule of thumb, a good conceptual question should be useful even to someone who isn't looking at the problem you happen to be working on. If you just need someone to check your work, you might seek out a friend, classmate, or teacher. $\endgroup$ – D.W. Jan 14 '18 at 20:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.