Theory of Computation and Compilers - Syntax Analysis

1. The pass numbers for each of the following activities
(i) object code generation
(ii) literals added to literal table
(iii) listing printed
(iv) address resolution of local symbols that occur in a two pass assembler respectively are

  • Option : B
  • Explanation :
    In two pass assembler,
    Purpose: Generate object program.
    1. Substitute the corresponding address for each symbol.
    2. Generate instruction, which are opcode are subst ituted for machine instruction.
    3. Data is generated.
    4. Some pseudo operations are also executed.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


2. The process of assigning load addresses to the various parts of the program and adjusting the code and data in the program to reflect the assigned addresses is called

  • Option : C
  • Explanation :
    Relocation of code is the process done by the linker-loader when a program is copied from external storage into main memory.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


3. Which of the following statements is false?

  • Option : A
  • Explanation :
    A grammar is said to be ambiguous if there exist more than one parse tree for a string.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


Consider the context free grammar
E → E + E
E → (E * E)
E → id
Where E is the starting symbol, the set of terminals is {id, (, + ,), *} and the set of non terminal is {E}.

4. Which of the following terminal strings has more than one parse tree where parsed according to above grammar?

  • Option : A
  • Explanation :

    Has more than one parse tree
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


Consider the context free grammar
E → E + E
E → (E * E)
E → id
Where E is the starting symbol, the set of terminals is {id, (, + ,), *} and the set of non terminal is {E}.

5. For the terminal string with more than one parse tree obtained as solution to in above Question, how many parse trees are possible?

  • Option : A
  • Explanation :
    Total 5 different parse trees are there.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *