The Gateway to Computer Science Excellence
0 votes

Please suggest me the approach to solve this kind of questions

Options are-

  1. Max(B1.val , value(n) ) , Min(C1.val , Value(n) )
  2. Min(B1.val , value(n )) , Min(C1.val , value(n) )
  3. Max(B1.val , value(n)) , Max(C1.val, value(n) )
  4. Min(B1.val , value(n) ) , Max(C1.val , value(n)
in Compiler Design by Active (1.6k points)
edited by | 69 views
D ?

should be D only.

But in the original SDT,

if it is not L-attributed, then S -> A sign // A.sign = Sign.sign, S.value = A.value

if it is L-attributed, then S -> sign A  // A.sign = Sign.sign, S.value = A.value


@Shaik Masthan if it is not L-attributed then S-attributed then how does A got the value of sign 

it doesn't mean, we are evaluating using only bottom-up parsers...

for using in bottom up parsers we redefine it

@Shaik Masthan @Shobhit Joshi

what is difference between C) and D) option?


@srestha The description of SDT says if the sign is $1\,i.e\,'+'$ we will take minimum of the two values, in $(C)$ we are taking maximum in $'+'$ and in $(D)$ we take minimum at position $B1$ as $B1$ came when the sign was $'+'$



in synthesis attributes definition

s -> C-  is with negative sign

so for

c-> c1,n we have to take minimum of (c1.value and value(n)) as given in L-attribute definition

Please log in or register to answer this question.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,833 questions
57,748 answers
108,143 users