0% found this document useful (0 votes)
8 views

BIT_R_5_comp and design const_Sept 2022

This examination paper is for the Bachelor of Information Technology (Hons) course in Compiler and Design Constructions, consisting of three sections: Multiple Choice Questions (MCQ), Short Answer Questions (MSAQ), and Long Answer Questions (MEQ). Candidates are required to answer all questions in Section A, five questions in Section B, and two questions in Section C, with specific instructions regarding the examination process. The paper covers various topics related to compilers, language processing, and finite state machines.

Uploaded by

Madan Tiwari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

BIT_R_5_comp and design const_Sept 2022

This examination paper is for the Bachelor of Information Technology (Hons) course in Compiler and Design Constructions, consisting of three sections: Multiple Choice Questions (MCQ), Short Answer Questions (MSAQ), and Long Answer Questions (MEQ). Candidates are required to answer all questions in Section A, five questions in Section B, and two questions in Section C, with specific instructions regarding the examination process. The paper covers various topics related to compilers, language processing, and finite state machines.

Uploaded by

Madan Tiwari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

EXAMINATION PAPER

FACULTY : COMPUTER SCIENCE AND MULTIMEDIA

COURSE : BACHELOR OF INFORMATION TECHNOLOGY (Hons)

YEAR/ SEMESTER : THIRD YEAR / SEMESTER FIVE

MODULE TITLE : COMPILER AND DESIGN CONSTRUCTIONS

CODE : BIT 354

TIME ALLOWED : 3 HOURS

Instruction to candidates
1. This question paper has THREE (3) Sections.

2. Answer ALL questions in Section A, MCQ.

3. Answer 5 questions in Section B, MSAQ.

4. Answer 2 questions in Section C, MEQ.

5. No scripts or answer sheets are to be taken out of the Examination Hall.

6. For Section A, answer in the OMR form provided.

Do not open this question paper until instructed


(Candidates are required to give their answers in their own words as far as practicable)

1
SECTION A
Multiple Choice Questions
Attempt All Questions [30×1=30]

1. Machine code is a type of :


A. High level programming language
B. Low level programming language
C. Both ‘A’ and ‘B’
D. None of the above

2. Compiler is ______ than interpreter.


A. faster
B. slower
C. smarter
D. none of the above

3. Compiler is a type of :
A. Machine code
B. Language translator
C. High level language
D. Programming

4. High level language is converted to assembly language by:


A. Compiler
B. Assembler
C. Both ‘A’ and ‘B’
D. None of the above

5. Which of the following statements is false?


A. An unambiguous grammar has same leftmost and rightmost derivation
B. An LL(1) parser is a top-down parser
C. LALR is more powerful than SLR
D. An ambiguous grammar can never be LR(k) for any k

6. Three address code involves:


A. Exactly 3 address
B. At the most 3 address
C. No unary operator
D. None of the above

2
7. When a computer is first turned on or restarted, a special type of absolute
loader is executed called:
A. Compile and go loader
B. Boot loader
C. Boot strap loader
D. Relating loader

8. When is type checking usually done?


A. During semantic analysis
B. During lexical analysis
C. During code optimization
D. During syntax analysis

9. In a compiler, when is the keyboards of language are recognized:


A. During the lexical analysis of the program
B. During parsing of the program
C. During the code generation
D. During the data flow analysis

10. Compiler translates the source code to:


A. Executable file
B. Machine code
C. Binary code
D. Both ‘B’ and ‘C’

11. Which of the following derivations does a top-down parser use while
parsing an input string? The input is assumed to be scanned in left to
right order.
A. Leftmost derivation
B. Leftmost derivation traced out in reverse
C. Rightmost derivation
D. Rightmost derivation traced out in reverse
12. Compiler should report the presence of ______ in the source program, in
translation process.
A. classes
B. objects
C. errors
D. text
3
13. Lexical analysis is about breaking a sequence of characters into:
A. Groups
B. Packets
C. Lines
D. Tokens

14. In a compiler, the data structure is responsible the management of


information about variables and their attributes is:
A. Semantic stack
B. Parse table
C. Symbol table
D. Abstract syntax-tree

15. Which of the following do we use to form an NFA from regular


expression?
A. Subset Construction Method
B. Power Set Construction Method
C. Thompsons Construction Method
D. Scott Construction Method

16. Which of the following can be example of application of finite state


machine?
A. Communication link
B. Adder
C. Stack
D. None of the above

17. Which of the following is NOT an application of FSM?


A. Lexical Analyser
B. BOT
C. State Charts
D. All of the above

18. The linker:


A. Is similar to interpreter
B. Uses source code as its input
C. Is required to create a module
D. None of the above

4
19. Parse
tree is use in:
A. Syntax analysis
B. Lexical analysis
C. Code optimization
D. None of the above

20. ______ may have epsilon transition.


A. DFA
B. NFA
C. Both ‘A’ and ‘B’
D. None of the above

21. The grammar is called ambiguous if it contains ______ Parse tree.


A. 1
B. 2
C. 3
D. 4

22. Grammar of the programming is checked at ______ phase of compiler.


A. semantic analysis
B. syntax analysis
C. code optimization
D. code generation

23. Anoptimizer compiler:


A. Is optimized to occupy less space
B. Optimize code
C. Both ‘A’ and ‘B’
D. None of the above

24. Synthesizedattribute can be easily simulated by a:


A. LL grammer
B. Ambiguous grammer
C. LR grammer
D. None of the above

5
25. Compiler can check ______ error.
A. logical
B. syntax
C. content
D. both ‘A’ and ‘B’

26. Which of the following is the fastest logic?


A. TTL
B. ECL
C. CMOS
D. LSI

27. Alatch is constructed using two cross coupled:


A. AND OR gates
B. AND gates
C. NAND and NOR gates
D. NAND gates

28. Theidentification of common sub expression and replacement of run time


computation by compile time computation is :
A. Loop Optimization
B. Local Optimization
C. Constant folding
D. Data Flow analysis

29. Shift
reduce parsers are:
A. Top down Parser
B. Bottom Up parser
C. May be top down or bottom up
D. None of the above

30. The output of a lexical analyzer is:


A. Machine code
B. Intermediate code
C. A parse tree
D. A stream of token

6
SECTION B
Short Answer Questions
Attempt any five (5) questions out of eight (8) questions [5×6=30]

1. Explain language processing system with diagram.

2. Design a NFA with ∑ = {0, 1} accepts those string which starts with 1 and
ends with 0.

3. Define lexical analyzer. How lexical error can be minimized.[2+4]

4. Describe the semantic analysis with its roles.

5. Explain regular expression with example and rules.

6. Define intermediate code generation. Draw syntax tree of x = (a+b*c) / (a–


b*c) [2+4]

7. Describe how code is optimized using peephole optimizing.

8. Elaborate the different types of errors in compiler.

7
SECTION C
Long Answer Questions
Attempt any two (2) questions out of three (3) questions [2×20=40]

1. Define compiler with its role in language processing. Explain different phases
required to convert high level language into target program. [8+12]

2. Explain NFA with different tuples. Construct the transition table for the
given NFA and convert it into equivalent DFA. [6+14]

3. Write the L-attributed definition and s-attributed definition. Find first and
follow sets from the given grammar. [8+12]
S → aB/bA
S → aS/bAA/a
B → bS / aBB/b

****BEST OF LUCK****

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy