Welcome to the Syntax Directed Definition and Translations MCQs Page
Dive deep into the fascinating world of Syntax Directed Definition and Translations with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Syntax Directed Definition and Translations, a crucial aspect of Compiler Design. In this section, you will encounter a diverse range of MCQs that cover various aspects of Syntax Directed Definition and Translations, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within Compiler Design.
Check out the MCQs below to embark on an enriching journey through Syntax Directed Definition and Translations. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of Compiler Design.
Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Syntax Directed Definition and Translations. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!
Syntax Directed Definition and Translations MCQs | Page 4 of 12
Explore more Topics under Compiler Design
S > ER
R > * E{print{โ * โ);
R | f
E > F + E{print(โ + โ); | F F > (S) | id{print(id.value);}
Here id is a taken that represents an integer and id, value represents the corresponding integer value. For an input โ2 * 3 + 4โ, this translation scheme prints
for if i # i } } }
Which one to the following false?
E E .val E .VAL E .val
E # E E .val E .VAL E .val
;
The above grammar and the semantic rules are fed to a yacc tool (which is an LALR (1) parser generator) for parsing and evaluating arithmetic expressions. Which one of the following is true about the action of yacc for the given grammar?
E E .val E .VAL E .val
E # E E .val E .VAL E .val
;
Assume the conflicts part (a) of this question are resolved and an LALR (1) parser is generated for parsing arithmetic expressions as per the given grammar.
Consider an expression 3 # 2 + 1. What precedence and associativity properties does the generated parser realize?
S -> S * E
S -> E
E -> F + E
E -> F
F -> id
Consider the following LR (0) items corresponding to the grammar above.
(i) S -> S * .E
(ii) E -> F. + E
(iii) E โF + .E
Given the items above, which two of them will appear in the same set in the canonical sets-of-items for the grammar?
S -> FR
R -> * S | ฮต
F -> id
In the predictive parser table, M, of the grammar the entries M [S, id] and M [R, $] respectively
S -> ER
R -> * E{print{โ * โ);
R | f
E -> F + E{print(โ + โ); | F
F -> (S) | id{print(id.value);}
Here id is a taken that represents an integer and id. value represents the corresponding integer value. For an input โ2 * 3 + 4โ, this translation scheme prints
for for if i # i } } }
Which one to the following false?
L = (a i b i | i ! j}?
C -> aCb |!
C -> aCb |!
A -> aA |!
A -> aA | a
B -> Bb |!
B -> bB | b
Suggested Topics
Are you eager to expand your knowledge beyond Compiler Design? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!