Compiler Design
106501Module 1 : Introduction & Lexical Analysis
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
View this question on its own page →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) 12Q1a. Which phase of compiler converts source code into tokens? (i) Code generation (ii) Lexical analysis (iii) Optimization (iv) Parsing20252m
Module 1 : Introduction & Lexical Analysis
View this question on its own page →Which phase of compiler converts source code into tokens?
(i) Code generation
(ii) Lexical analysis
(iii) Optimization
(iv) ParsingQ1a. 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
View this question on its own page →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 treeQ1b. 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
View this question on its own page →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'Q1b. Which data structure is mainly used in lexical analysis? (i) Queue (ii) Stack (iii) Tree (iv) Finite automata20252m
Module 1 : Introduction & Lexical Analysis
View this question on its own page →Which data structure is mainly used in lexical analysis?
(i) Queue
(ii) Stack
(iii) Tree
(iv) Finite automataQ1c. 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
View this question on its own page →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 optimizerQ1c. Which automaton accepts regular languages? (i) PDA (ii) DFA (iii) Turing machine (iv) LBA20252m
Module 1 : Introduction & Lexical Analysis
View this question on its own page →Which automaton accepts regular languages?
(i) PDA
(ii) DFA
(iii) Turing machine
(iv) LBAQ1e. 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
View this question on its own page →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 compilerQ2a. 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
View this question on its own page →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.
Q2a. Define Compiler. Explain all phases of a compiler with neat diagram.20257m
Module 1 : Introduction & Lexical Analysis
View this question on its own page →Define Compiler. Explain all phases of a compiler with neat diagram.
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
View this question on its own page →What is the difference between a compiler and an interpreter? Discuss the different components of a language processing system using work-flow diagram.
Q2a. Explain the working of each phase of compiler in detail with an example.20227m
Module 1 : Introduction & Lexical Analysis
View this question on its own page →Explain the working of each phase of compiler in detail with an example.
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
View this question on its own page →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.
Q2b. Construct a DFA for the regular expression r = 0^*1^*2^*.20257m
Module 1 : Introduction & Lexical Analysis
View this question on its own page →Construct a DFA for the regular expression .
Q3a. Design a finite automaton that accepts all binary strings that do not contain the substring "101".20247m
Module 1 : Introduction & Lexical Analysis
View this question on its own page →Design a finite automaton that accepts all binary strings that do not contain the substring "101".
Q4a. What is the pass of a compiler? Explain how the single- and multi-pass compilers work.20197m
Module 1 : Introduction & Lexical Analysis
View this question on its own page →What is the pass of a compiler? Explain how the single- and multi-pass compilers work.
Q6a. Explain different phases of compiler.20197m
Module 1 : Introduction & Lexical Analysis
View this question on its own page →Explain different phases of compiler.
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
View this question on its own page →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'.
Q7a. Write down the differences between DFA and NFA.20257m
Module 1 : Introduction & Lexical Analysis
View this question on its own page →Write down the differences between DFA and NFA.
Q9a. Convert the regular expression (a+b)^*ab into NFA.20257m
Module 1 : Introduction & Lexical Analysis
View this question on its own page →Convert the regular expression into NFA.
Q9b. Write short notes on: Lex and Yaac20237m
Module 1 : Introduction & Lexical Analysis
View this question on its own page →Write short notes on: Lex and Yaac