Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Tests  >  Compiler Design  >  Test: Top Down Parsing - Computer Science Engineering (CSE) MCQ

Test: Top Down Parsing - Computer Science Engineering (CSE) MCQ


Test Description

10 Questions MCQ Test Compiler Design - Test: Top Down Parsing

Test: Top Down Parsing for Computer Science Engineering (CSE) 2024 is part of Compiler Design preparation. The Test: Top Down Parsing questions and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus.The Test: Top Down Parsing MCQs are made for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: Top Down Parsing below.
Solutions of Test: Top Down Parsing questions in English are available as part of our Compiler Design for Computer Science Engineering (CSE) & Test: Top Down Parsing solutions in Hindi for Compiler Design course. Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free. Attempt Test: Top Down Parsing | 10 questions in 10 minutes | Mock test for Computer Science Engineering (CSE) preparation | Free important questions MCQ to study Compiler Design for Computer Science Engineering (CSE) Exam | Download free PDF with solutions
Test: Top Down Parsing - Question 1

Which of the following derivations does a top-down parser use while parsing an input string?

Detailed Solution for Test: Top Down Parsing - Question 1

Explanation: In top down parser takes input from Left to right constructing leftmost derivation of the sentence.

Test: Top Down Parsing - Question 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

Detailed Solution for Test: Top Down Parsing - Question 2

Explanation: Relocation is the process of replacing symbolic references or names of libraries with actual usable addresses in memory before running a program. Linker performs it during compilation.

1 Crore+ students have signed up on EduRev. Have you? Download the App
Test: Top Down Parsing - Question 3

Which of the following statements is false?

Detailed Solution for Test: Top Down Parsing - Question 3

Explanation: If a grammar has more than one leftmost (or rightmost) derivation the grammar is ambiguous. Sometimes in unambiguous grammar the rightmost derivation and leftmost derivations may differ.

Test: Top Down Parsing - Question 4

Which of the following grammar rules violate the requirements of an operator grammar?
(i) P -> QR
(ii) P -> QsR
(iii) P -> ε
(iV) P -> QtRr

Detailed Solution for Test: Top Down Parsing - Question 4

Explanation:
An operator precedence parser is a bottom-up parser that interprets an operator-precedence grammar.
Consider the grammar with the following translation rules and E as the start symbol.
A -> A1 #B {A.value = A1.value * B.value}
| B {A.value = B.value}
B-> B1 & F {B.value = B1.value + C.value}
|C {B.value= C.value }
C -> num {C.value = num.value}.

Test: Top Down Parsing - Question 5

Consider the grammar with the following translation rules and E as the start symbol.

E → E1 # T { E.value = E1.value * T.value }

| T{ E.value = T.value }

T → T1 & F { T.value = T1.value + F.value }

| F{ T.value = F.value }

F → num { F.value = num.value }

Compute E.value for the root of the parse tree for the expression:2 # 3 & 5 # 6 &4.

Detailed Solution for Test: Top Down Parsing - Question 5

Explanation:higher precedence operator will never produce an expression with operator with lower precedence.&># in terms of precedence order.

Test: Top Down Parsing - Question 6

Given the following expression grammar:
E -> E * F | F + E | F
F -> F - F | id
which of the following is true?

Test: Top Down Parsing - Question 7

Consider a program P that consists of two source modules M1(contains reference to a function defined in M2) and M2 contained in two different files.

Detailed Solution for Test: Top Down Parsing - Question 7

Explanation:
Compiler transforms source code into the machine language which is in binary .
Kinds of object codes:
defined symbols, which allow it to be called by other modules,
ii undefined symbols, which call the other modules where these symbols are defined, and
iii symbols which are used internally within object file for relocation.

Test: Top Down Parsing - Question 8

Which of the following suffices to convert an arbitrary CFG to an LL(1) grammar?

Detailed Solution for Test: Top Down Parsing - Question 8

Explanation:
Factoring as well as left recursion removal do not suffice to convert an arbitrary CFG to LL(1) grammar.

Test: Top Down Parsing - Question 9

Assume that the SLR parser for a grammar G has n1 states and the LALR parser for G has n2 states.

Detailed Solution for Test: Top Down Parsing - Question 9

Explanation: SLR parser has less range of context free languages than LALR but still both n1 & n2 are same for SLR & LALR respectively.

Test: Top Down Parsing - Question 10

 Which of the following describes a handle (as applicable to LR-parsing) appropriately?

Detailed Solution for Test: Top Down Parsing - Question 10

Explanation: the next step in LR parsing shall have Reduction .

26 videos|66 docs|30 tests
Information about Test: Top Down Parsing Page
In this test you can find the Exam questions for Test: Top Down Parsing solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Top Down Parsing, EduRev gives you an ample number of Online tests for practice

Top Courses for Computer Science Engineering (CSE)

26 videos|66 docs|30 tests
Download as PDF

Top Courses for Computer Science Engineering (CSE)