Symbol-Table
Question 1 |
(a) Write syntax directed definitions (semantic rules) for the following grammar to add the type of each identifier to its entry in the symbol table during semantic analysis. Rewriting the grammar is not permitted and semantic rules are to be added to the ends of productions only.
D → TL;
T → int
T → real
L → L, id
L → id
(b) Write 3-address intermediate code (quadruples) for the following boolean expression in the sequence as it would be generated by a compiler. Partial evaluation of Boolean expressions is not permitted. Assume the usual rules of precedence of the operators.
(a + b) > (c + d) or a > c and b < d
Theory Explanation. |
Question 2 |
An email contains a textual birthday greeting, a picture of a cake and a song. The order is not important. What is the content-type?
Multipart/mixed | |
Multipart/parallel | |
Multipart/digest | |
Multipart/alternative |
Question 2 Explanation:
The Multipart/parallel subtype
This document defines a "parallel" subtype of the multipart Content- Type. This type is syntactically identical to multipart/mixed, but the semantics are different. In particular, in a parallel entity, the order of body parts is not significant.
This document defines a "parallel" subtype of the multipart Content- Type. This type is syntactically identical to multipart/mixed, but the semantics are different. In particular, in a parallel entity, the order of body parts is not significant.
Question 3 |
The access time of the symbol table will be logarithmic if it is implemented by
Linear list | |
Search tree | |
Hash table | |
Self organization list |
Question 3 Explanation:
Access time of the symbolic table will be logarithmic if it is implemented by search time.
There are 3 questions to complete.
