69 views

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)

edited | 69 views
0
D ?
0

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

0

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

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

for using in bottom up parsers we redefine it
0

what is difference between C) and D) option?

0

@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 $'+'$

0

@Sreshta

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