wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

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

A
Syntax of recursive procedures
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
variable names of arbitrary length.
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
Syntax of if-then-else statements
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
Whether a variable has been declared before its use
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
Open in App
Solution

The correct option is D Whether a variable has been declared before its use
(a) The language corresponding to syntax of if then-else statements is context-free language So syntax of if-then-else statements can be captured by context-free grammar.
(b) The language corresponding to syntax of recursive procedures is context-free language.So syntax of recursive procedures can be captured by context-free-grammar.
(c) The language corresponding to variable has been declared before its use is
L={ww | w is variable}
L is context sensitive language.So the feature,that a variable has been declared before its use can't be captured by context free grammar.
(d) The feature that variable names of arbitrary length can be captured by context free grammar.

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Definition of Variables
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon