...
Theory-of-Computation
March 6, 2024
Theory-of-Computation
March 6, 2024
Theory-of-Computation
March 6, 2024
Theory-of-Computation
March 6, 2024

GATE 1994

Question 18

Which of the following features cannot be captured by context-free grammars?

A
Syntax of if-then-else statements
B
Syntax of recursive procedures
C
Whether a variable has been declared before its use
D
Variable names of arbitrary length
Question 18 Explanation: 
Context free grammars are used to represent syntactic rules while designing a compiler.
Syntactic rules not checking the meaningful things such as if a variable is declared before it use (or) not.
Like this, things are handled by semantic analysis phase.
Correct Answer: C
Question 18 Explanation: 
Context free grammars are used to represent syntactic rules while designing a compiler.
Syntactic rules not checking the meaningful things such as if a variable is declared before it use (or) not.
Like this, things are handled by semantic analysis phase.

Leave a Reply

Your email address will not be published. Required fields are marked *