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  
A
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?
A
Multipart/mixed
B
Multipart/parallel
C
Multipart/digest
D
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.
Question 3
The access time of the symbol table will be logarithmic if it is implemented by
A
Linear list
B
Search tree
C
Hash table
D
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.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access