in Compiler Design recategorized by
2,111 views
1 vote
1 vote

Which of the following statements is false?

  1. Top-down parsers are LL parsers where first L stands for left-to-right scan and second L stands for a leftmost derivation
  2. (000)* is a regular expression that matches only strings containing an odd number of zeroes, including the empty string
  3. Bottom-up parsers are in the LR family, where L stands for left-to-right scan and R stands for rightmost derivation
  4. The class of context-free languages is closed under reversal. That is, if L is any context-free language, then the language $L^R =\{w^R: w \varepsilon L\}$ is context-free
in Compiler Design recategorized by
2.1k views

2 Answers

2 votes
2 votes
Best answer
  1. (000)* is a regular expression that matches only strings containing an odd number of zeroes, including the empty string also caontain 6, 12, 18, 24 which are even .

B is answer

selected by
0 votes
0 votes
  • Top-down parsers are LL parsers where first L stands for left – to – right scan and second L stands for a leftmost derivation.Correct

 

  • (000)* is a regular expression that matches only strings containing an odd number of zeroes, including the empty string.Incorrect (000)* will generate ε, 000, 000000, 000000000, …….. multiples of 3 which include odd and even strings, so this is incorrect.

 

  • Bottom-up parsers are in the LR family, where L stands for left – to – right scan and R stands for rightmost derivation.Correct

 

  • The class of context – free languages is closed under reversal. That is, if L is any context – free language, then the language LR = {wR: w∈L} is context – free.Correct

So, option (B) is correct.

Answer:

Related questions