List of top Computer Science and IT Engineering Questions

Consider the following two syntax-directed definitions SDD1 and SDD2 for type
declarations.
๐ท is the start symbol, and ๐‘–๐‘›๐‘ก, ๐‘“๐‘™๐‘œ๐‘Ž๐‘ก and ๐‘–๐‘‘ are the three terminals. The non-terminal
๐‘‰1 is the same as ๐‘‰ and the non-terminal ๐ท1 is the same as ๐ท. Here, the subscript is
used to differentiate the grammar symbols on the two sides of a production. The
function ๐‘๐‘ข๐‘ก updates the symbol table with the type information for an identifier.
Let P and Q be the languages specified by grammars G1 and G2, respectively.
Which of the following statements is/are true?
SDD1
Grammar
(G1)
Semantic Rules
๐ท โ†’๐‘‡ ๐‘‰
๐ท. ๐‘ก๐‘ฆ๐‘๐‘’ = ๐‘‡. ๐‘ก๐‘ฆ๐‘๐‘’
๐‘‰. ๐‘ก๐‘ฆ๐‘๐‘’ = ๐‘‡. ๐‘ก๐‘ฆ๐‘๐‘’
๐‘‡ โ†’ ๐‘–๐‘›๐‘ก
๐‘‡. ๐‘ก๐‘ฆ๐‘๐‘’ = ๐‘–๐‘›๐‘ก
๐‘‡ โ†’ ๐‘“๐‘™๐‘œ๐‘Ž๐‘ก
๐‘‡. ๐‘ก๐‘ฆ๐‘๐‘’ = ๐‘“๐‘™๐‘œ๐‘Ž๐‘ก
๐‘‰โ†’๐‘‰1 ๐‘–๐‘‘
๐‘‰1. ๐‘ก๐‘ฆ๐‘๐‘’= ๐‘‰. ๐‘ก๐‘ฆ๐‘๐‘’
๐‘๐‘ข๐‘ก(๐‘–๐‘‘. ๐‘’๐‘›๐‘ก๐‘Ÿ๐‘ฆ, ๐‘‰. ๐‘ก๐‘ฆ๐‘๐‘’)
๐‘‰ โ†’ ๐‘–๐‘‘
๐‘๐‘ข๐‘ก(๐‘–๐‘‘. ๐‘’๐‘›๐‘ก๐‘Ÿ๐‘ฆ, ๐‘‰. ๐‘ก๐‘ฆ๐‘๐‘’)
SDD2
Grammar
(G2)
Semantic Rules
๐ทโ†’๐ท1 ๐‘–๐‘‘
๐ท. ๐‘ก๐‘ฆ๐‘๐‘’= ๐ท1. ๐‘ก๐‘ฆ๐‘๐‘’
๐‘๐‘ข๐‘ก(๐‘–๐‘‘. ๐‘’๐‘›๐‘ก๐‘Ÿ๐‘ฆ, ๐ท1. ๐‘ก๐‘ฆ๐‘๐‘’)
๐ท โ†’ ๐‘‡ ๐‘–๐‘‘
๐ท. ๐‘ก๐‘ฆ๐‘๐‘’ = ๐‘‡. ๐‘ก๐‘ฆ๐‘๐‘’
๐‘๐‘ข๐‘ก(๐‘–๐‘‘. ๐‘’๐‘›๐‘ก๐‘Ÿ๐‘ฆ, ๐‘‡. ๐‘ก๐‘ฆ๐‘๐‘’)
๐‘‡ โ†’๐‘–๐‘›๐‘ก
๐‘‡. ๐‘ก๐‘ฆ๐‘๐‘’ = ๐‘–๐‘›๐‘ก
๐‘‡ โ†’ ๐‘“๐‘™๐‘œ๐‘Ž๐‘ก
๐‘‡. ๐‘ก๐‘ฆ๐‘๐‘’ = ๐‘“๐‘™๐‘œ๐‘Ž๐‘ก