1.

Which of the following features cannot be captured by CFG?(a) Syntax of if-then-else statements(b) Syntax of recursive procedures(c) A variable is declared before its use(d) Matching nested parenthesisI had been asked this question in examination.This interesting question is from Implementation of the Translation Specified by Syntax-Directed Definitions in chapter Syntax Directed Definition and Translations of Compiler

Answer»

The CORRECT answer is (d) Matching nested parenthesis

Best explanation: It is because, it is equivalent to RECOGNIZING US, where the first w is the DECLARATION and the second is its USE, we are not a CFG.



Discussion

No Comment Found

Related InterviewSolutions