GATE Assistant

Past questions › Computer Science and Information Technology › GATE 2021 set1

GATE 2021 set1 · CS · MCQ · 2 marks · Compiler Design › Semantic Analysis

GATE 2021 set1 Computer Science and Information Technology question: Consider the following grammar (that admits a series of declarations, followed by…

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:

With respect to the above grammar, which one of the following choices is correct?

  1. (A)

    The actions can be used to correctly type-check any syntactically correct program.

  2. (B)

    The actions can be used to type-check syntactically correct integer variable declarations and integer expressions.

  3. (C)

    The actions can be used to type-check syntactically correct boolean variable declarations and boolean expressions.

  4. (D)

    The actions will lead to an infinite loop.

Show answer

Official answer: B

Practise this question with exam-style marking

Discussion

No discussion yet.

Join the discussion