GATE CSE
First time here? Checkout the FAQ!
x
+1 vote
131 views

 

 

Fill in the blanks

Consider the $SDTS$ below

$E1\rightarrow E \ out (*2)$

$E \rightarrow +T \ out('1')$

$E \rightarrow T \ out (10^*)$

$E \rightarrow T*F \ out ( ' * ' )$

$T \rightarrow F \ out ('100+')$

$F \rightarrow num \ out (num \ val)$

The input is $1+1*1$ and the output generated is evaluated as an arithmetic expression . The value obtained is _____________.

Ans =2200

 

  correct ans 2212


I am not getting the answer, plz help. [SDT tracing by default is left-recursive, right??]

 

 

 

asked in Compiler Design by Loyal (2.5k points)   | 131 views
m getting 100102 ..
i got this 1100+10*100+1*1*2

@ sayantan  -    1100 + 10 * 1100 + 1 * 1 * 2

       Can U retry..

Yes. i am also getting the same!! 1100 + 10 * 1100 + 1 * 1 * 2

@Amsar i checked already,twice..nly it will come.but dont know how calculate the result,means by following bodmas or something else

Please log in or register to answer this question.

Top Users Jan 2017
  1. Debashish Deka

    7172 Points

  2. Habibkhan

    4696 Points

  3. Vijay Thakur

    4308 Points

  4. sudsho

    4090 Points

  5. saurabh rai

    4024 Points

  6. Arjun

    3292 Points

  7. santhoshdevulapally

    3066 Points

  8. GateSet

    3016 Points

  9. Bikram

    3014 Points

  10. Sushant Gokhale

    2892 Points

Monthly Topper: Rs. 500 gift card

18,838 questions
23,808 answers
51,589 comments
20,148 users