• edited by
1,818 views
2 2 votes

Statement : L attributed grammer can be evaluated using bottom up parsing.

Doubt : L attributed has both types, synthesized as well as left inherited grrammer. So in L attributed grammer how will be left inherited attributes be evaluated (which need preorder traversal)?

Something like this : 

1 Answer

3 3 votes

Your Statement is wrong  L attributed Grammar can not be evaluated using bottom up parsing.

L-attributed grammars are a special type of attribute grammars. They allow the attributes to be evaluated in one depth-first left-to-right traversal of the abstract syntax tree. As a result, attribute evaluation in             L-attributed grammars can be incorporated conveniently in top-down parsing.

Position:
Show:

Related questions

0 0 votes
1 1 answer
1.8k
1.8k views
Na462 asked Oct 8, 2018
1,774 views
I know that every S attributed grammar is L attributed but not vice versa. Can anybody give example of the case if i print the semantic rules using L attributed the resul...
0 0 votes
2 2 answers
1.6k
1.6k views
jaswanth431 asked Nov 16, 2021
1,601 views
If the grammar has only S-attributed semantic definitions, in a top down parser we will add the semantic action at the end of production and it will we executed when we...
0 0 votes
1 1 answer
2.8k
2.8k views
radha gogia asked May 6, 2018
2,750 views
E->TE'E'->*T { printf('*') ;} E' | epsilonT- id {printf (id.name) ;}A) E->E*T | T {printf('*');}T->id {printf(id.name);}B) E->TE'E'->*TME' | epsilonM->epsilon { printf('...
0 0 votes
1 answers 1 answer
645
645 views
atul_21 asked Nov 28, 2017
645 views