Computer Science EngineeringHard
Eliminating the left recursion from E -> E + T | T yields
- A. E -> T E', E' -> T E' | epsilon
- B. E -> E' T, E' -> + E' | epsilon
- C. E -> + T E | T
- D. E -> T E', E' -> + T E' | epsilon
Correct answer: D. E -> T E', E' -> + T E' | epsilon
A -> A alpha | beta becomes A -> beta A', A' -> alpha A' | epsilon, with alpha = + T and beta = T.
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
- 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
- The language denoted by the regular expression empty-set star (the Kleene star of the empty set) is