edited by
448 views
2 votes
2 votes
Which of the following statements is correct?
 

(A) For any context free grammar there is a parser that takes at most O(n2) to parse a string for n terminals.

(B) Recursive descent method can't be used to both parse and implement syntax-directed translation.

(C) Software tools for generating parsers directly from grammars often use top-down methods.

(D) None of the above.
edited by

1 Answer

0 votes
0 votes
They mentioned any CFG it can be (Ambiguous or Unambiguous).

So there is one Parser comes into mind that is Operator Precedence parser, which takes O(n^2), it can be reduced to O(2n) by making Function table.

option A is correct.

Related questions