Computer Science EngineeringHardISRO SC
Consider the grammar S -> A b | B c; A -> a A | epsilon; B -> a B | d. Is the grammar LL(1)? If so the predictive parse table has how many filled entries; if not, answer "Not LL(1)".
- A. 7
- B. 9
- C. Not LL(1)
- D. 6
Correct answer: C. Not LL(1)
Some table cell receives two productions (FIRST/FOLLOW overlap, left recursion, or a common prefix), so it is not LL(1).
Practise more Theory of Computation, Compilers & Digital Logic (ISRO CS) questionsTheory of Computation, Compilers & Digital Logic (ISRO CS): notes and key points
More Theory of Computation, Compilers & Digital Logic (ISRO CS) questions
- Three-address code: 1: x1 = x2 + 1; 2: x2 = x3 + 2; 3: x3 = x1 + 3; 4: x1 = x2 + 4; 5: x2 = x3 + 5; 6: goto 8; 7: x1 = x2 + 7; 8: if x1 <…
- Using Sethi-Ullman labelling (a left leaf needs 1 register, a right leaf operand can be a memory operand and needs 0), the minimum number…
- In register allocation by graph colouring, the interference graph has nodes v0..v7 and edges v0-v1, v0-v3, v0-v4, v0-v5, v1-v2, v1-v3…
- A flow graph has blocks B1: use{a,d} def{b}; B2: use{a} def{b,d}; B3: use{d} def{a,b,c}; B4: use{a} def{}. Edges: B1->B2, B2->B3, B2->B4…
- Build the DAG for ((((c + a) + (b - a)) ((a b) + (b + a))) + (((a b) + (b + a)) + ((a b) + (b + a)))) using value numbering, treating +…
- A scanner uses maximal munch with identifiers [a-z][a-z0-9], decimals digits(.digits)?, and operators/punctuators including <<=, <<, <=…