Compiler Design

106501
Back to Compiler Design

Module 3 : Semantic Analysis & Symbol Table

  1. 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

    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 these

    View this question on its own page →
  2. Q1a. 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

    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 analysis

    View this question on its own page →
  3. Q1e. 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

    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)

    View this question on its own page →
  4. 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

    Choose the correct option / answer the following:
    In S-attributed definitions, all attributes are:
    (i) Inherited
    (ii) Explicit
    (iii) Static
    (iv) Synthesized

    View this question on its own page →
  5. Q1f. 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

    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 grammar

    View this question on its own page →
  6. Q1g. 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

    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 structure

    View this question on its own page →
  7. Q1g. 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

    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 these

    View this question on its own page →
  8. Q1g. 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

    Synthesized attributes are evaluated from

    (i) Parent to child
    (ii) Child to parent
    (iii) Left to right
    (iv) Right to left

    View this question on its own page →
  9. Q1h. 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

    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 errors

    View this question on its own page →
  10. Q1h. 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

    Which attribute is commonly stored in symbol table?

    (i) Variable type
    (ii) Address
    (iii) Scope
    (iv) All of these

    View this question on its own page →
  11. Q2a. What is an activation record? Explain how they are used to access various local and global variables.20197m

    Module 3 : Semantic Analysis & Symbol Table

    What is an activation record? Explain how they are used to access various local and global variables.

    View this question on its own page →
  12. 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

    For the given grammar and associated semantic rules. Find the output for the input: aadbd.
    SAS{print(1)};SAB{print(2)};Aa{print(3)};BbC{print(4)};S \rightarrow AS \{print(1)\}; S \rightarrow AB \{print(2)\}; A \rightarrow a \{print(3)\}; B \rightarrow bC \{print(4)\};
    BdB{print(5)};Ce{print(6)}B \rightarrow dB \{print(5)\}; C \rightarrow e \{print(6)\}

    View this question on its own page →
  13. 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

    Construct a syntax-directed translation scheme that translates arithmetic expressions from infix notation into prefix notation. Give annotated parse trees for the inputs 95+29 - 5 + 2 and 9529 - 5 * 2.

    View this question on its own page →
  14. 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

    What is the use of a symbol table? How are the identifiers stored in the symbol table?

    View this question on its own page →
  15. Q4b. Explain synthesized and inherited attributes with suitable examples.20257m

    Module 3 : Semantic Analysis & Symbol Table

    Explain synthesized and inherited attributes with suitable examples.

    View this question on its own page →
  16. 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

    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.

    View this question on its own page →
  17. Q5b. What is the syntax directed translation and why are they important?20197m

    Module 3 : Semantic Analysis & Symbol Table

    What is the syntax directed translation and why are they important?

    View this question on its own page →
  18. 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

    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.

    View this question on its own page →
  19. 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

    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.

    View this question on its own page →
  20. 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

    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.

    View this question on its own page →
  21. Q6b. Define Symbol Table. Discuss symbol table implementation techniques.20257m

    Module 3 : Semantic Analysis & Symbol Table

    Define Symbol Table. Discuss symbol table implementation techniques.

    View this question on its own page →
  22. 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

    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.

    View this question on its own page →
  23. Q7b. Differentiate between S-attributed SDDs and L-attributed SDDs with suitable examples.20227m

    Module 3 : Semantic Analysis & Symbol Table

    Differentiate between S-attributed SDDs and L-attributed SDDs with suitable examples.

    View this question on its own page →
  24. Q8a. Differentiate between S-attributed SDT and L-attributed SDT using suitable examples.20235m

    Module 3 : Semantic Analysis & Symbol Table

    Differentiate between S-attributed SDT and L-attributed SDT using suitable examples.

    View this question on its own page →
  25. Q9a. Differentiate between S-attribute SDT and L-attribute SDT with suitable examples.20197m

    Module 3 : Semantic Analysis & Symbol Table

    Differentiate between S-attribute SDT and L-attribute SDT with suitable examples.

    View this question on its own page →
  26. Q9a. Write short notes on: Activation Records20227m

    Module 3 : Semantic Analysis & Symbol Table

    Write short notes on: Activation Records

    View this question on its own page →
  27. Q9a. Write short notes on: Activation Record20237m

    Module 3 : Semantic Analysis & Symbol Table

    Write short notes on: Activation Record

    View this question on its own page →
  28. Q9c. Write short notes on: Symbol table20227m

    Module 3 : Semantic Analysis & Symbol Table

    Write short notes on: Symbol table

    View this question on its own page →