0% found this document useful (0 votes)
24 views7 pages

CS450 DLP Ut2 Obe

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)
24 views7 pages

CS450 DLP Ut2 Obe

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/ 7

Candidate seat No:

Charotar University of Science and Technology


Devang Patel Institute of Advance Technology and Research
Department of Computer Science & Engineering
Subject: CS450-Design of Language Processor
Unit Test – 2

Semester: 7th (B. Tech.) Maximum Marks: 30


Date: 1/11/2022, Tuesday Time: 10:00 am to 11:00 am

Instructions:
(i) Attempt all the questions.

Sr.No
Questions Marks CO BL

Identify the most powerful parser? A

A. LALR
1. B. Canonical LR
C. SLR 1 3
D. Operator-Precedence

Why is handle pruning used? E

2. A. Canonical Derivation Sequence


B. Both A & B 1 3
C. Canonical Reduction Sequence
D.None

Which of the following errors can a compiler check? A


A. Logical
3. B. Runtime 3
C. Syntax
D. Both A and B
1
4. Which parsing technique avoids backtracking? 1 A

A. Predictive Parsing
B. Top-down Parsing 3
C. Recursive descent Parsing
D. Both a & c
Through which type of grammar can synthesized attributes can be A
simulated?
A. Ambiguous grammar
B. LR Grammer
5 1 3
C. LL grammar
D. None

Consider the following grammer.

6 3 E

Which of the following is the correct option? 1

A. LALR(1) but not SLR(1)


B. LR(1) but not LALR(1)
C. SLR(1) but not LR(1)
D. LALR(1)

The following grammer is:


S  Aa | bAc | dc | bda
Aa
7 3
A. Neither LALR(1) nor SLR(1) 1 E
B. LALR(1) but SLR(1)
C. LALR(1) and SLR(1)
D. LALR(1) but not SLR(1)

A. 4 1 3
B. 5
C. 6
D. 7
The gramma S->SS | (S) | € is not suitable for CLR(1) parsing E
because the grammar is/are
1. Ambiguous

9 2. Left Recursive 1 3
3. Non-deterministic

A. Only I
B. Only I and II
C. Only II and III
D. I,II And III

R
YACC is an acronym for:
A. Yes Another Compile Compiler
B. Yet Another Compile Compiler
C. Yet Another Compiler Compiler
10 D. Yes Another Compiler Compiler 1 3

.............. in a flow graph whose heads dominate their tails. C


A. Font edges
B. Flow edges
C. Back edges
11. D. None of this 1 4

Convert the pre-fix expression to in-fix E

--*+ABC*DE+FG

12. A. (A-B)*C+(D*E)-(F+G) 1 4
B. (A+B)*C-(D-E)*(F-G)
C. (A+B-C)*(D-E)*(F+G)
D. (A+B)*C-(D*E)-(F+G)

Which graph describes the basic block and successor relationship? C

A. Control graph
B. DAG
C. Flow graph
13. D. Hamilton graph 1 4,5
................. uses only synthesized attributes. E

A. l-attribute grammar
B. S-attribute grammar
14. 1 4
C. inherited attribute
D. None of this

A grammar oriented technique known as : E

A. Lexical analyzer
B. Syntax directed translation (SDT)
15. C. Parsing 1 4
D. Both option A & B

___________ is a tool that depicts the structure of basic blocks,


helps to see the flow of values flowing among the basic blocks, and
offers optimization too.
A. DAG 4
B. CAG C

16. C. SAG 1
D. PAG

In Directed Acyclic Graph, Leaf nodes represent?


A. identifiers
B. names 4,5
C. constants
A
17. D. All of the above 1

Which of the following is not a form of Intermediate R


representation?

A. Abstract Syntax Tree 4,5


B. 3-address code
18. C. Directed cyclic Graph 1
D. Reverse Polish Notation

Code generation can be considered as the? U

A. first phase of compilation


B. second phase of compilation
C. third phase of compilation
19. 1 5
D. final phase of compilation

Which statement is an abstract form of intermediate code? E


A. 3-address
B. 2-address
C. address
20. D. intermediate code 1 5
E
Whenever a procedure is executed, its activation record is stored on
the stack, also known as?

A. Access Stack
21. B. Control stack 1 6
C. Formal Stack
D. Return Stack

In activation record, Which of the following Stores the address of E


activation record of the caller procedure?
A. Access Link
B. Actual Parameters
22. C. Control Link 1 6
D. Temporaries

The location of memory (address) where an expression is stored is A


known?

A. r-value
23. B. k-value 1 6
C. l-value
D. t-value

In which mechanism, the name of the procedure being called is R


replaced by its actual body?

24.
A. Pass by Reference 1 6
B. Pass by Name
C. Pass by Copy-restore
D. Pass by Object

Which of the following known as the text part of a program that U


does not change at runtime. Its memory requirements are known at
the compile time?
A. Code 6
B. Procedures
25. C. Variables 1
D. All of the above

Code generator uses ______ function to determine the status of


available registers and the location of name values.

A. setReg 6
B. cinReg A
26. C. pfReg 1
D. getReg
__________ are used to keep track of memory locations where the
values of identifiers are stored.

A. Register descriptor A
27. B. Address descriptor 1 6
C. Both A and B
D. None of the above

How many descriptors are used for track both the registers (for U
availability) and addresses (location of values) while generating the
code?

28. A. 2 1 6
B. 3
C. 4
D. 5

A
x * 2 can be replaced by x << 1 is an example of?

A. Algebraic expression simplification 6


B. Accessing machine instructions
29 C. Strength reduction 1
D. Code Generator

In Algebraic expression simplification, a = a + 1 can simply be A


replaced by?

A. a 6
30 B. INC a 1
C. DEC a
D. MUL a

Note:
CO – Course Outcomes
BL – Bloom’s Taxonomy Level

You might also like