edited by
573 views
1 votes
1 votes

Please tell me - 

1) What is top down evaluation of Parse tree?

2) What is Bottom Up evaluation of Parse Tree

3) What is Depth First left to right evaluation of Parse tree?

Is 1 and 3 are equal? 

Please make a small tree and show how to traverse Top down and Bottom up?

Also, Explain how Top down and Bottom up Parser work is it same as Tree evaluation?

edited by

1 Answer

Best answer
3 votes
3 votes

I don't have much idea about Depth first left to right parsing, but if you use stack for dfs and go from left to right in above case it gives same as top down parsing. I have done for one string and this is not the way to parse this string. Given is one way I followed for bot top down and bottom up.

Here reverse right most means you start from given string and map terminals one by one with variables from right side as shown by arrow.

selected by

Related questions

2 votes
2 votes
3 answers
1
Na462 asked Nov 19, 2018
6,641 views
0 votes
0 votes
0 answers
2
Lakshman Bhaiya asked Oct 22, 2018
664 views
find the vertical sum of a binary tree. For example,the tree has 5 vertical lines?
1 votes
1 votes
4 answers
3
samarpita asked Nov 18, 2021
1,314 views
Every unambiguous grammar is LR(0) grammar?
0 votes
0 votes
1 answer
4
aditi19 asked Mar 25, 2019
1,142 views
Can lookahead symbol be epsilon in LR(1) parsing?andpls give the LR(1) diagram for the following grammar?A->AB | aB->*AC | Cb | ∈C->+ABc | ∈