Computer Science EngineeringHard
For the grammar S -> aSb | c, what is FIRST(S)?
- A. {a}
- B. {c}
- C. {a, c}
- D. {b, c}
Correct answer: C. {a, c}
S begins with a in the first production and with c in the second.
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
- Eliminating the left recursion from E -> E + T | T yields
- When a code generator has no free register and stores a live value to memory to free one, the process is called
- By the Sethi-Ullman labelling, the minimum number of registers needed to evaluate (a + b) (c + d) without spilling is
- By the maximal munch rule, how many tokens does a C scanner find in x = y+++z; ?
- When several lexemes could be matched by different Lex rules, Lex picks
- The language {a^n b^m | n != m} is