Compiler Design

106501
Back to Compiler Design

Module 1 : Introduction & Lexical Analysis

  1. Q1a. Choose the correct option / answer the following: During lexical analysis, how many tokens are identified in the following statement? while(count<=10) count = count + 1; (i) 9 (ii) 11 (iii) 10 (iv) 1220242m

    Module 1 : Introduction & Lexical Analysis

    Choose the correct option / answer the following:
    During lexical analysis, how many tokens are identified in the following statement? while(count<=10) count = count + 1;
    (i) 9
    (ii) 11
    (iii) 10
    (iv) 12

    View this question on its own page →
  2. Q1a. Which phase of compiler converts source code into tokens? (i) Code generation (ii) Lexical analysis (iii) Optimization (iv) Parsing20252m

    Module 1 : Introduction & Lexical Analysis

    Which phase of compiler converts source code into tokens?

    (i) Code generation
    (ii) Lexical analysis
    (iii) Optimization
    (iv) Parsing

    View this question on its own page →
  3. Q1a. Choose the correct answer of the following: The output of a lexical analyzer is (i) a machine code (ii) an intermediate code (iii) a stream of tokens (iv) a parse tree20222m

    Module 1 : Introduction & Lexical Analysis

    Choose the correct answer of the following:
    The output of a lexical analyzer is
    (i) a machine code
    (ii) an intermediate code
    (iii) a stream of tokens
    (iv) a parse tree

    View this question on its own page →
  4. Q1b. Choose the correct option / answer the following: Which of the following is NOT accepted by finite automata? (i) Palindromes (ii) Strings with even number of a's (iii) Binary strings divisible by 3 (iv) Strings ending with 'ab'20242m

    Module 1 : Introduction & Lexical Analysis

    Choose the correct option / answer the following:
    Which of the following is NOT accepted by finite automata?
    (i) Palindromes
    (ii) Strings with even number of a's
    (iii) Binary strings divisible by 3
    (iv) Strings ending with 'ab'

    View this question on its own page →
  5. Q1b. Which data structure is mainly used in lexical analysis? (i) Queue (ii) Stack (iii) Tree (iv) Finite automata20252m

    Module 1 : Introduction & Lexical Analysis

    Which data structure is mainly used in lexical analysis?

    (i) Queue
    (ii) Stack
    (iii) Tree
    (iv) Finite automata

    View this question on its own page →
  6. Q1c. Choose the correct answer of the following: In a compiler, ________ checks every character of the source text. (i) the lexical analyzer (ii) the syntax analyzer (iii) the code generator (iv) the code optimizer20192m

    Module 1 : Introduction & Lexical Analysis

    Choose the correct answer of the following:
    In a compiler, ________ checks every character of the source text.
    (i) the lexical analyzer
    (ii) the syntax analyzer
    (iii) the code generator
    (iv) the code optimizer

    View this question on its own page →
  7. Q1c. Which automaton accepts regular languages? (i) PDA (ii) DFA (iii) Turing machine (iv) LBA20252m

    Module 1 : Introduction & Lexical Analysis

    Which automaton accepts regular languages?

    (i) PDA
    (ii) DFA
    (iii) Turing machine
    (iv) LBA

    View this question on its own page →
  8. Q1e. Choose the correct answer of the following: A compiler for a high-level language that runs on one machine and produce code for different machines is called (i) optimizing compiler (ii) one-pass compiler (iii) cross-compiler (iv) multipass compiler20222m

    Module 1 : Introduction & Lexical Analysis

    Choose the correct answer of the following:
    A compiler for a high-level language that runs on one machine and produce code for different machines is called
    (i) optimizing compiler
    (ii) one-pass compiler
    (iii) cross-compiler
    (iv) multipass compiler

    View this question on its own page →
  9. Q2a. Describe the major phases of a compiler, highlighting the role of each phase in the compilation process. Illustrate your answer with a neat and labeled diagram of the compilation phases.20247m

    Module 1 : Introduction & Lexical Analysis

    Describe the major phases of a compiler, highlighting the role of each phase in the compilation process. Illustrate your answer with a neat and labeled diagram of the compilation phases.

    View this question on its own page →
  10. Q2a. Define Compiler. Explain all phases of a compiler with neat diagram.20257m

    Module 1 : Introduction & Lexical Analysis

    Define Compiler. Explain all phases of a compiler with neat diagram.

    View this question on its own page →
  11. Q2a. What is the difference between a compiler and an interpreter? Discuss the different components of a language processing system using work-flow diagram.20237m

    Module 1 : Introduction & Lexical Analysis

    What is the difference between a compiler and an interpreter? Discuss the different components of a language processing system using work-flow diagram.

    View this question on its own page →
  12. Q2a. Explain the working of each phase of compiler in detail with an example.20227m

    Module 1 : Introduction & Lexical Analysis

    Explain the working of each phase of compiler in detail with an example.

    View this question on its own page →
  13. Q2b. Differentiate between Deterministic Finite Automata (DFA) and Non-Deterministic Finite Automata (NFA). Also, explain the procedure to convert an NFA to DFA with a suitable example.20247m

    Module 1 : Introduction & Lexical Analysis

    Differentiate between Deterministic Finite Automata (DFA) and Non-Deterministic Finite Automata (NFA). Also, explain the procedure to convert an NFA to DFA with a suitable example.

    View this question on its own page →
  14. Q2b. Construct a DFA for the regular expression r = 0^*1^*2^*.20257m

    Module 1 : Introduction & Lexical Analysis

    Construct a DFA for the regular expression r=012r = 0^*1^*2^*.

    View this question on its own page →
  15. Q3a. Design a finite automaton that accepts all binary strings that do not contain the substring "101".20247m

    Module 1 : Introduction & Lexical Analysis

    Design a finite automaton that accepts all binary strings that do not contain the substring "101".

    View this question on its own page →
  16. Q4a. What is the pass of a compiler? Explain how the single- and multi-pass compilers work.20197m

    Module 1 : Introduction & Lexical Analysis

    What is the pass of a compiler? Explain how the single- and multi-pass compilers work.

    View this question on its own page →
  17. Q6a. Explain different phases of compiler.20197m

    Module 1 : Introduction & Lexical Analysis

    Explain different phases of compiler.

    View this question on its own page →
  18. Q6a. Define regular expression. Write the regular expression for the language having a string which should have at least one '0' and at least one '1'.20257m

    Module 1 : Introduction & Lexical Analysis

    Define regular expression. Write the regular expression for the language having a string which should have at least one '0' and at least one '1'.

    View this question on its own page →
  19. Q7a. Write down the differences between DFA and NFA.20257m

    Module 1 : Introduction & Lexical Analysis

    Write down the differences between DFA and NFA.

    View this question on its own page →
  20. Q9a. Convert the regular expression (a+b)^*ab into NFA.20257m

    Module 1 : Introduction & Lexical Analysis

    Convert the regular expression (a+b)ab(a+b)^*ab into NFA.

    View this question on its own page →
  21. Q9b. Write short notes on: Lex and Yaac20237m

    Module 1 : Introduction & Lexical Analysis

    Write short notes on: Lex and Yaac

    View this question on its own page →