Compiler Design
106501Module 3 : Semantic Analysis & Symbol Table
Q1a. Choose the correct answer of the following: Synthesized attributes are calculated (i) from the values of attributes of the children of the node (ii) from the values of attributes of the parent of the node (iii) from the values of attributes of the siblings of the node (iv) None of these20232m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Choose the correct answer of the following:
Synthesized attributes are calculated
(i) from the values of attributes of the children of the node
(ii) from the values of attributes of the parent of the node
(iii) from the values of attributes of the siblings of the node
(iv) None of theseQ1a. Choose the correct answer of the following: When is the type checking usually done? (i) During syntax directed translation (ii) During lexical analysis (iii) During code optimization (iv) During syntax analysis20192m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Choose the correct answer of the following:
When is the type checking usually done?
(i) During syntax directed translation
(ii) During lexical analysis
(iii) During code optimization
(iv) During syntax analysisQ1e. Choose the correct answer of the following: In an absolute loading scheme, which loader function is accomplished by programmer? (i) Allocation (ii) Linking (iii) Reallocation (iv) Both (i) and (ii)20192m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Choose the correct answer of the following:
In an absolute loading scheme, which loader function is accomplished by programmer?
(i) Allocation
(ii) Linking
(iii) Reallocation
(iv) Both (i) and (ii)Q1e. Choose the correct option / answer the following: In S-attributed definitions, all attributes are: (i) Inherited (ii) Explicit (iii) Static (iv) Synthesized20242m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Choose the correct option / answer the following:
In S-attributed definitions, all attributes are:
(i) Inherited
(ii) Explicit
(iii) Static
(iv) SynthesizedQ1f. Choose the correct option / answer the following: Which of the following is used to determine the evaluation order of attributes? (i) Symbol table (ii) Transition table (iii) Dependency graph (iv) Abstract grammar20242m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Choose the correct option / answer the following:
Which of the following is used to determine the evaluation order of attributes?
(i) Symbol table
(ii) Transition table
(iii) Dependency graph
(iv) Abstract grammarQ1g. Choose the correct answer of the following: The languages that need heap allocation in the runtime environment are those that (i) use global variables (ii) use dynamic scoping (iii) support recursion (iv) allow dynamic data structure20192m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Choose the correct answer of the following:
The languages that need heap allocation in the runtime environment are those that
(i) use global variables
(ii) use dynamic scoping
(iii) support recursion
(iv) allow dynamic data structureQ1g. Choose the correct answer of the following: A dangling reference is a .............. (i) pointer pointing to storage which is freed (ii) pointer pointing to unutilized storage (iii) pointer pointing to null (iv) none of these20232m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Choose the correct answer of the following:
A dangling reference is a ..............
(i) pointer pointing to storage which is freed
(ii) pointer pointing to unutilized storage
(iii) pointer pointing to null
(iv) none of theseQ1g. Synthesized attributes are evaluated from (i) Parent to child (ii) Child to parent (iii) Left to right (iv) Right to left20252m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Synthesized attributes are evaluated from
(i) Parent to child
(ii) Child to parent
(iii) Left to right
(iv) Right to leftQ1h. Choose the correct option / answer the following: The symbol table stores information about: (i) Only variables (ii) Only functions (iii) Identifiers and their attributes (iv) Syntax errors20242m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Choose the correct option / answer the following:
The symbol table stores information about:
(i) Only variables
(ii) Only functions
(iii) Identifiers and their attributes
(iv) Syntax errorsQ1h. Which attribute is commonly stored in symbol table? (i) Variable type (ii) Address (iii) Scope (iv) All of these20252m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Which attribute is commonly stored in symbol table?
(i) Variable type
(ii) Address
(iii) Scope
(iv) All of theseQ2a. What is an activation record? Explain how they are used to access various local and global variables.20197m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →What is an activation record? Explain how they are used to access various local and global variables.
Q2b. For the given grammar and associated semantic rules. Find the output for the input: *aadbd*. S \rightarrow AS \{print(1)\}; S \rightarrow AB \{print(2)\}; A \rightarrow a \{print(3)\}; B \rightarrow bC \{print(4)\}; B \rightarrow dB \{print(5)\}; C \rightarrow e \{print(6)\}20227m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →For the given grammar and associated semantic rules. Find the output for the input: aadbd.
Q2b. Construct a syntax-directed translation scheme that translates arithmetic expressions from infix notation into prefix notation. Give annotated parse trees for the inputs 9 - 5 + 2 and 9 - 5 * 2.20237m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Construct a syntax-directed translation scheme that translates arithmetic expressions from infix notation into prefix notation. Give annotated parse trees for the inputs and .
Q3b. What is the use of a symbol table? How are the identifiers stored in the symbol table?20197m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →What is the use of a symbol table? How are the identifiers stored in the symbol table?
Q4b. Explain synthesized and inherited attributes with suitable examples.20257m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Explain synthesized and inherited attributes with suitable examples.
Q5a. Define syntax-directed definitions (SDD). Explain the difference between S-attributed and L-attributed definitions. Give an example of each and explain how attributes are evaluated.20247m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Define syntax-directed definitions (SDD). Explain the difference between S-attributed and L-attributed definitions. Give an example of each and explain how attributes are evaluated.
Q5b. What is the syntax directed translation and why are they important?20197m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →What is the syntax directed translation and why are they important?
Q5b. Explain the process of attribute evaluation in a syntax tree. Discuss the construction and use of dependency graphs and the evaluation order of attributes. Give an example.20247m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Explain the process of attribute evaluation in a syntax tree. Discuss the construction and use of dependency graphs and the evaluation order of attributes. Give an example.
Q6a. What is a symbol table in a compiler? Describe its structure and how it supports semantic analysis. Explain with an example how a symbol table is constructed and maintained during compilation.20247m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →What is a symbol table in a compiler? Describe its structure and how it supports semantic analysis. Explain with an example how a symbol table is constructed and maintained during compilation.
Q6b. Explain the different attributes stored in a symbol table for a variable and a function. Discuss how these attributes are used during type checking and semantic analysis.20247m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Explain the different attributes stored in a symbol table for a variable and a function. Discuss how these attributes are used during type checking and semantic analysis.
Q6b. Define Symbol Table. Discuss symbol table implementation techniques.20257m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Define Symbol Table. Discuss symbol table implementation techniques.
Q7a. What are the different parameter passing mechanisms in programming languages? Explain with examples the working of call-by-value, call-by-reference, and call-by-name. Also, discuss their impact on memory and scope.20247m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →What are the different parameter passing mechanisms in programming languages? Explain with examples the working of call-by-value, call-by-reference, and call-by-name. Also, discuss their impact on memory and scope.
Q7b. Differentiate between S-attributed SDDs and L-attributed SDDs with suitable examples.20227m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Differentiate between S-attributed SDDs and L-attributed SDDs with suitable examples.
Q8a. Differentiate between S-attributed SDT and L-attributed SDT using suitable examples.20235m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Differentiate between S-attributed SDT and L-attributed SDT using suitable examples.
Q9a. Differentiate between S-attribute SDT and L-attribute SDT with suitable examples.20197m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Differentiate between S-attribute SDT and L-attribute SDT with suitable examples.
Q9a. Write short notes on: Activation Records20227m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Write short notes on: Activation Records
Q9a. Write short notes on: Activation Record20237m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Write short notes on: Activation Record
Q9c. Write short notes on: Symbol table20227m
Module 3 : Semantic Analysis & Symbol Table
View this question on its own page →Write short notes on: Symbol table