1 Qs · 2016 · 2 marks · 0.1 marks/paperStandard yield
In Compiler Design, Context-Free Grammars (CFGs) are evaluated on their ability to correctly specify programming language constructs such as multi-dimensional array declarations, v… Guide
Topic guide
In Compiler Design, Context-Free Grammars (CFGs) are evaluated on their ability to correctly specify programming language constructs such as multi-dimensional array declarations, variable definitions, and control structures. GATE tests the candidate's ability to trace derivations, verify language equivalence, and ensure that semantic and syntactic constraints (e.g., minimum dimension ) are strictly satisfied.
Grammar Validation for Programming Language Constructs
rare · MCQ · 2 marks · 2016
Candidates are given a concrete language construct (such as a C-like multi-dimensional array declaration) and two candidate CFGs ( and ), and must determine which grammar(s) correctly derive strings of the required format.
General form for multi-dimensional array declaration
Determining whether candidate grammars derive all and only valid 1D and multi-dimensional array definitions.
Focus is placed on applying CFG concepts to practical programming language syntax specifications (e.g., recursive bracket matching in multi-dimensional declarations) rather than purely abstract language theory.
2016
Medium: Requires tracing base cases (1D array) and recursive cases (2D or higher dimension) across non-trivial production splits to verify that no spurious syntax is allowed and all valid strings are generable.