Skip to content
Early access — you're among the first to try PYQLabs. Share feedback

Semantic Analysis

GATE CSE & IT · 29 questions across 18 years (1990-2026) · 45% recurrence rate

Recurrence sparkline

19902026
199020082026

Difficulty mix

easy 34%
med 66%

Question types

MCQ24
NAT2
MTF2
MSQ1

All 29 questions on Semantic Analysis

2026 PYQ

$$ \text { Consider the following two syntax-directed definitions SDD1 and SDD2 for type declarations. } $$ SDD1 Grammar(G1) $$ \text { Semantic Rules } $$ $$ \mathrm{D} \rightarrow \mathrm{TV} $$ $$ \begin{aligned} & \t...

Med
2025 PYQ

Given the following syntax directed translation rules : Rule 1 : $R \rightarrow A B\{B . i=R . i-1 ; A . i=B . i R . i=A . i+1 ;\}$ Rule 2 : $P \rightarrow C D\{P . i=C . i+D . i ; D . i=C . i+2\}$ Rule 3 : $Q \rightarro...

Med
2025 PYQ

Consider the following statements about the use of backpatching in a compiler for (I) Backpatching can be used to generate code for Boolean expression in one pass. (II) Backpatching can be used to generate code for flow-...

Easy
2024 PYQ

Which of the following statements is/are FALSE?

Med
2024 PYQ

Consider the following syntax-directed definition (SDD). S → DHTU { S.val = D.val + H.val + T.val + U.val; } D → “M” D 1 { D.val = 5 + D 1 .val; } D → ε { D.val = –5; } H → “L” H 1 { H.val = 5 * 10 + H 1 .val; } H → ε {...

Med
2023 PYQ

Consider the syntax directed translation given by the following grammar and semantic rules. Here N, I, F and B are non-terminals. N is the starting non-terminal, and #, 0 and 1 are lexical tokens corresponding to input l...

Med
2022 PYQ

Consider the following grammar along with translation rules. S $$\to$$ S 1 # T {S.val = S 1 .val * T.val} S $$\to$$ T {S.val = T.val} T $$\to$$ T 1 %R {T.val = T 1 .val $$ \div $$ R.val} T $$\to$$ R {T.val = R.val} R $$\...

Med
2021 PYQ

Consider the following grammar (that admits a series of declarations, followed by expressions) and the associated syntax directed translation (SDT) actions, given as pseudo-code: P → D* E* D → int ID {record that ID.lexe...

Med
2021 PYQ

Consider the following ANSI C program: int main() { Integer x; return 0; } Which one of the following phases in a seven-phase C compiler will throw an error?

Easy
2020 PYQ

Consider the productions A $$ \to $$ PQ and A $$ \to $$ XY. Each of the five non-terminals A, P, Q, X, and Y has two attributes: s is a synthesized attribute, and i is an inherited attribute. Consider the following rules...

Med
2019 PYQ

Consider the following grammar and the semantic actions to support the inherited type declaration attributes. Let $X_1, X_2, X_3, X_4, X_5$, and $X_6$ be the placeholders for the nonterminals $\mathrm{D}, \mathrm{T}, \ma...

Med
2018 PYQ

Which one of the following statements is FALSE?

Easy
2016 PYQ

Consider the following Syntax Directed Translation Scheme $$(SDTS),$$ with non-terminals $$\left\{ {S,A} \right\}$$ and terminals $$\left\{ {A,B} \right\}.$$ $$S \to aA$$ $$\,\,\,\,\,$${ print $$1$$ } $$S \to a$$ $$\,\,\...

Med
2016 PYQ

Consider the following C program void f(int, short); void main() { int i = 100; short s = 12; short *p = &s; __________ ; // call to f() } Which one of the following expressions, when placed in the blank above, will NOT...

Easy
2014 PYQ

Which one of the following is NOT performed during compilation?

Easy
2006 PYQ

Consider the following translation scheme. $$\eqalign{ & S \to ER \cr & R \to *E\left\{ {pr{\mathop{\rm int}} ('*');} \right\}R\,|\,\varepsilon \cr & E \to F + E\left\{ {pr{\mathop{\rm int}} (' + ');} \right\}\,|\,F \cr...

Med
2005 PYQ

Consider the following C program: double foo(double); /* Line 1 */ int main () { double da, db; //input da db = foo(da); } double foo(double a){ return a; } The above code compiled without any error or warning. If Line 1...

Med
2005 PYQ

A common property of logic programming languages and functional languages is:

Easy
2005 PYQ

Which one of the following are essential features of an object-oriented programming language? i) Abstraction and encapsulation ii) Strictly-typedness iii) Type-safe property coupled with sub-type rule iv) Polymorphism in...

Easy
2004 PYQ

Consider the grammar with the following translation rules and E as the start symbol. $$\eqalign{ & E \to {E_1}\# T\,\,\left\{ {E.value = {E_1}.value*T.value} \right\} \cr & \,\,\,\,\,\,\,\,\,\,\,\,\,\,|T\,\,\,\,\,\,\,\,\...

Med
2004 PYQ

Choose the best matching between the programming style in Group 1 and their characteristics in Group 2 Group 1 P. Functional Q. Logic R. Object-oriented S. Imperative Group 2 1. Command-based, procedural 2. Imperative, a...

Easy
2003 PYQ

Consider the following class definitions in a hypothetical Object Oriented language that supports inheritance and uses dynamic binding. The language should not be assumed to be either Java or C++, though the syntax is si...

Med
2003 PYQ

Which of the following statements is FALSE?

Med
2003 PYQ

Which of the following statements is FALSE ?

Med
2003 PYQ

Consider the translation scheme shown below $$\eqalign{ & S \to TR \cr & R \to + T\left\{ {pr{\mathop{\rm int}} (' + ');} \right\}\,R\,|\,\varepsilon \cr & T \to num\,\left\{ {pr{\mathop{\rm int}} (num.val);} \right\} \c...

Med
2003 PYQ

In a bottom-up evaluation of a syntax directed definition, inherited attributes can

Med
1998 PYQ

Type checking is normally done during

Easy
1995 PYQ

A shift reduce parser carries out the actions specified within braces immediately after reducing with the corresponding rule of grammar. $$\eqalign{ & S \to xxW\,\left\{ {pr{\mathop{\rm int}} \,'1'} \right\} \cr & S \to...

Med
1990 PYQ

Match the pairs in the following: List - I (A) Small talk (B) LISP (C) Prolog (D) VAL List - II (p) Logic programming (q) Data flow programming (r) Functional programming (s) Object-Oriented programming

Easy