Sale!

Original price was: ₹200.00.Current price is: ₹20.00.

Advance Compiler Test: Embrace the challenge with our 1-hour online assessment. Aim for a minimum of 60% to successfully pass and demonstrate your Compiler Design prowess. Perfect for students studying Compiler Design worldwide and essential for those preparing for Indian competitive exams like GATE, NET, SLET, DRDO, and ISRO. Buy now.

Unlock the Power of Learning: Your Way to Excellence Begins Here! When you buy this great academic product at an amazing price, we’ll send you an exclusive PASSWORD to the email address you gave us. Use this password without any trouble to start an online test on Nuutan.com. Please remember that the password you’re given is valid for a full 10 days, starting from the day you buy it. This gives you plenty of time to look around. Take advantage of this limited-time chance and start your journey toward mastery of knowledge today.

Categories: , , , , , Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Product ID: 3368

Description

Advance Compiler Test – Master the Challenge with our Comprehensive 1-Hour Online Assessment

0%

Master Compiler Design: A Valuable Resource for Worldwide University Students Studying Compiler Design as a Subject. In India, it is ideal for B.Tech., M.Tech., BCA, MCA Studies and Competitive Exams - GATE CS, UGC-NET CS, SLET CS, DRDO CSE, ISRO CS, BHEL Engineer Trainee IT/CS, and More! Get Your Essential Resource Today!

 

TIME ENDS

Created by A guru on the website nuutan.com

Advance Compiler Test: Master in 1 Hour, Score 60% to Pass

Pass the MCQ-style online practice test with a minimum score of 60% in just 60 minutes, covering 33 questions at the intermediate or advanced level.

IF YOU GET 60% OR MORE, WE WILL SEND A CERTIFICATE TO YOUR EMAIL ADDRESS. PLEASE FILL IN CORRECTLY.

1 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

1) Consider the following FIRSTs and FOLLOWs:

FIRST(X) = { b, d, f }

FIRST(Y) = { b, d }

FIRST(Z) = { c, e }

FOLLOW(d) = { c, e }

FOLLOW(e) = { a }

FOLLOW(f) = { $ }

FOLLOW(X) = { $ }

FOLLOW(Y) = { c, e }

FOLLOW(Z) = { a }

FOLLOW(a) = { $ }

FOLLOW(b) = { b, d }

FOLLOW(c) = { c, e }

Which of the following grammars satisfies the given FIRST and FOLLOW sets?

(a)        X -> Ya | f

            Y -> bY | d

            Z -> cZ | e

(b)        X -> YZa | f

            Y -> bY | d

            Z -> cZ | e

(c)        X -> bY | d

            Y -> Ya | f

            Z -> cZ | e

(d)       X -> bY | e

            Y -> cZ | d

            Z -> Ya | f

SELECT THE CORRECT OPTION.

2 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

2) Consider the following grammar:

S -> aS | bS | abaA

A -> ε | aA | bA

Consider the following statements.

STATEMENT1: Parse table of given grammar contains two rows and three columns.

STATEMENT2: Parse table can be constructed by using FIRST set only

STATEMENT3: FIRST sets for non-terminals S and A contains 3 elements.

STATEMENT4: FOLLOW(S) = FOLLOW(A) = {$, a}.

STATEMENT5: Given grammar is LL(1).

SELECT THE CORRECT OPTION.

3 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

3) Consider the following grammar.

exp′ -> exp $

exp -> id

exp -> ( exp )

exp -> ( id ) exp                          ($ is end marker)

Consider the following statements.

STATEMENT1: This grammar is SLR

STATEMENT2: This grammar is not SLR

STATEMENT3: This grammar is LR(0)

STATEMENT4: This grammar is not LR(0)

WHICH OF THE STATEMENTS ARE TRUE?

4 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

4) Consider the following grammar:

E -> A | B

A -> a | c

B -> b | c

Consider the following statements:

STATEMENT1: Given grammar is LR(1).

STATEMENT2: Given grammar is LL(1) and SLR(1).

WHICH OF THE FOLLOWING STATEMENTS IS CORRECT?

5 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

5) Consider the following statements.

STATEMENT1: LL(k) parsing uses the next ‘k’ input tokens.

STATEMENT2: LL(k) parsing is more powerful than LL(1) parsing.

STATEMENT3: LL(k) languages are proper subset of LL(k-1) languages.

STATEMENT4: C Programming language is LL(1).

STATEMENT5: LL(1) grammar does not exists for the programming language.

WHICH OF THE FOLLOWING STATEMENTS ARE TRUE?

6 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

6) Consider the following statements.

STATEMENT1: LL(1) operates from Left to Right and produces Leftmost derivation.

STATEMENT2: In Deterministic parsing, each parse table entry contains at most one element.

WHICH OF THE FOLLOWING STATEMENTS ARE TRUE?

7 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

7) Consider the following statements.

STATEMENT1: LL(k) parsing uses all of the left context of the string being parsed.

STATEMENT2: Strong LL(k) parsing does not use any of the left context of the parse.

STATEMENT3: LL(k) parsing is more stronger than strong LL(k) parsing.

STATEMENT4: Strong LL(k) parsing is more stronger than LL(k) parsing.

SELECT THE CORRECT OPTION.

8 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

8) Consider the following grammar:

S -> aS | aSbS | c

PART1:

Consider the following two statements:

STATEMENT1: Given grammar is left recursive.

STATEMENT2: Given grammar is suitable for predictive parsing.

Which of the following statements is correct?

(a) Statement1 and Statement2 are both true

(b) Statement1 is true, Statement2 is false

(c) Statement1 is false, Statement2 is true

(d) Statement1 and Statement2 are both false

PART2:

Consider the following two statements:

STATEMENT1: Given grammar is ambiguous.

STATEMENT2: Given grammar is regular.

Which of the following statements is correct?

(a) Statement1 and Statement2 are both true

(b) Statement1 is true, Statement2 is false

(c) Statement1 is false, Statement2 is true

(d) Statement1 and Statement2 are both false

SELECT THE CORRECT OPTION.

9 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

9) Consider the following statements.

STATEMENT1: We cannot use regular expression to define MICRO programming language.

STATEMENT1: LA stands for “Look Ahead Merged” in LALR(1) parsing.

WHICH OF THE FOLLOWING STATEMENTS ARE TRUE?

10 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

10) Take a look at the following grammar:

A -> Bx | yC | ε

B -> CzA

C -> xB

PART1: NULLABLE non-terminals?

(a) A                (b) B               

(c) C                (d) A and B

PART2: FIRST(A)?

(a) { y }            (b) { x, y }       

(c) { y, z }        (d) { x, y, z }

PART3: FIRST(B)?

(a) { x }            (b) { y }                       

(c) { z }            (d) { x, y }

PART4: FIRST(C)?

(a) { x }            (b) { y }                       

(c) { z }            (d) { x, y }

PART5: FOLLOW(A)?

(a) { x }            (b) { y }                       

(c) { z }            (d) { x, z }

PART6: FOLLOW(B)?

(a) { x }            (b) { y }                       

(c) { z }            (d) { x, z }

PART7: FOLLOW(C)?

(a) { x }            (b) { y }                       

(c) { z }            (d) { x, z }

PART8: Is this grammar LL(1)?

(a) Yes             (b) No                                                                                                 

(c) Cannot be answered with information provided.

(d) The LL(1) checker would go into an infinite loop.

SELECT THE CORRECT OPTION.

11 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

11) Consider the following statements:

STATEMENT1: The grammar:

S -> 0|12|345

is LL(1).

STATEMENT2: The grammar

S -> 0|T1

T -> 1|S0

is LL(1).

STATEMENT3: The grammar

S -> 0|11|01

is LL(1).

WHICH OF THE FOLLOWING STATEMENTS ARE TRUE?

12 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

12) Consider the following grammar:

S' -> S$

S -> xSS

S -> y

Consider the following statements:

STATEMENT1: The grammar is SLR.

STATEMENT2: This grammar is not SLR.

STATEMENT3: The grammar is LR(0).

STATEMENT4: This grammar is not LR(0).

WHICH OF THE FOLLOWING STATEMENTS ARE TRUE?

13 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

13) Consider the following statements.

STATEMENT1: Parse tree and abstract Syntax Tree (AST) are different terms.

STATEMENT2: A parse tree captures the structure of the program according to its grammar and AST captures the structure of the program independent of the grammar.

STATEMENT3: It is better to generate AST before producing code, rather than producing code directly.

WHICH OF THE FOLLOWING STATEMENTS ARE TRUE?

14 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

14) Let us assume that we have just come up with a new kind of compiler optimization that can improve the run-time of code by a factor of 10, but is very slow. For code that normally takes 10 seconds to run, the compiler takes 1000 seconds to perform the optimization, but the optimize code runs in 1 second.

PART1:

Select the correct preference.

(a) Prefer to implement this optimization using just-in-time compiler.

(b) Prefer to implement this optimization using cross compiler.

(c) Prefer to implement this optimization using standard compiler (that compile code before it runs).

(d) Prefer to implement this optimization using self-compiler.

PART2:

Suppose this optimization requires seeing the high-level structure of code (e.g., the loops in the code). Select the correct option.

(a) This optimization takes place in front-end of compiler.

(b) This optimization takes place in back-end of compiler.

(c) This optimization takes place in both the ends.

(d) Half optimization takes place in front-end and rest half optimization takes place in back-end.

SELECT THE CORRECT OPTION.

15 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

15) Consider the following three grammars.

GRAMMAR1:                      

A -> BC

B -> Ax | x

C -> yC | y     

GRAMMAR2:

A -> BC

B -> Ax | x | ε

C -> yC | y    

GRAMMAR3:           

A -> BC

B -> Ax | x | ε

C -> yC | y | ε  

For each of the following statements about FIRST and FOLLOW sets, indicate for which grammar(s) (1, 2, or 3) the statement is TRUE.

(1) FIRST(A) = {x, y} =

(2) FOLLOW(A) = {$, x} =

(3) FOLLOW(B) = {$, x, y} =

(4) FIRST(C) = {y} =

(5) FOLLOW(C) = {$, x} =

SELECT THE CORRECT OPTION.

16 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

16) For each of the following tasks, indicate the earliest stage of the compiler that can always perform that task or detect the situation. Assume the compiler is a conventional one that generates native code (x86, MIPS, et cetera) for a language like C++ or JAVA. Use the following abbreviations to identify the stages:

SCAN: Scanner

PARSE: Parser

SEM: Semantics / Type-check

OPT: Optimization

INSTR: Instruction selection & scheduling

REG: Register allocation

RUN: Runtime, that is, when the compiled code is executed

CANNOT: Cannot be done during compilation or execution

(1) A comment beginning with /* terminates with */ before the end of the file.

(2) A variable is declared at most once in a scope (function, class, etc.)

(3) Add code to temporarily store a value when there aren’t enough registers to hold all live values at a given point in the program.

(4) Replace array subscripting (a[i] = 0; i+=) and a test (i

(5) Warn the programmer that the declaration of a variable in a subclass hides (shadows) the declaration of the same variable in a super class.

SELECT THE CORRECT OPTION.

17 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

17) Give any context-free grammar in answer to the questions in this part, i.e., it does not matter if the grammar is LL(1), unambiguous, or any other subclass of all context-free grammars.

PART1:  

Consider the following FIRST and FOLLOW sets.

FIRST(S) = {b, ε}

FIRST(T) = {b, ε}

FOLLOW(S) = {a, $}

FOLLOW(T) = {a, b, $}

Give the simplest grammar (fewest productions and shortest right-hand side) that produces these sets, where S is the start symbol.

(a)        S -> Tb | T

            T -> bSa| ε

(b)        S -> Ta | b

            T -> T | bSa | ε

(c)        S -> Tb | ε

            T -> bSa | ε

(d)       S -> Ta | bSa

            T -> a | b | ε

PART2:

Select a grammar with single non-terminal S such that FIRST(S) = Phi.

(a)        S -> S         

(b)        S -> ε          

(c)        S -> T           

(d)       S -> a

PART3:

Select a grammar with single non-terminal S such that FIRST(S) = (FOLLOW(S)–{$}) = Phi.

(a)        S -> aSa        

(b)        S -> aSb      

(c)        S -> aTa       

(d)       S -> aS

PART4:

Select a grammar with a shift-reduce conflict.

(a)        S -> Ta | a

            T -> ε

(b)        S -> Tb | b

            T -> a

(c)        S -> Sa | ε

(d)       S -> S|T|a

            T -> ε

SELECT THE CORRECT OPTION.

18 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

18) Consider the following grammar:

S -> Aa | b | bB

A -> a

B -> b

WHICH PARSING METHOD WORKS MORE EFFICIENT FOR IT?

19 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

19) Compilers are almost always doing Parsing and Semantic/Type-checking in separate phases of compiler. So, why this separation into phases is done?

(1) It is better modularity to separate the two jobs so the parser and semantics checker can each do one thing well.

(2) It is easier to get right and easier to maintain.

(3) There are many things we need to check that are not captured by a context-free specification. These either cannot be done in the parser, or require backtracking.

(4) Checking for type compatibility in expression and assignment statements is not a work of parser.

SELECT THE CORRECT OPTION.

20 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

20) Consider the following statements.

STATEMENT1: Hand-written parser is much more powerful than that is generated by a parser generator.

STATEMENT2: LL(inf) is a form of top-down parsing.

STATEMENT3: An LL parser is a deterministic, canonical top-down parser for context-free grammars.

STATEMENT4: An LR parser is a deterministic, canonical bottom-up parser for context-free grammars.

STATEMENT5: LL(*) parsing only backtracks over repeating constructs to resolve conflicts.

WHICH OF THE FOLLOWING STATEMENTS ARE TRUE?

21 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

21) Consider a bottom-up parser for a grammar with no ε production and no single production (i.e., productions with a single symbol on the right-hand side). For an input string with n tokens, what is the maximum number of reduce moves the parser can take?

22 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

22) A context-free grammar over 0 and 1 has three non-terminals S, A, and B. We know the following about the FIRST and FOLLOW sets of these non-terminals.

FIRST(S) = { 0, 1 }      

FOLLOW(S) = { 0, $ }         

FIRST(A) = { ε }         

FOLLOW(A) = { 0, 1 }

FIRST(B) = { ε }             

FOLLOW(B) = { 0, 1 }

PART1:

Which of the following context-free grammar satisfies the given FIRST and FOLLOW sets?

(a)       S -> 0 | 1 | AS0 | BS0

            A -> ε

            B -> ε

(b)        S -> 0 | 1 | BS0

            A -> AS0 | 1

            B -> ε

(c)        S -> 0 | 1 | BS0

            A -> ε

            B -> AS0 | 1

(d)       S -> 0 | 1 | AS0 | BS0

            A -> 0 | 1

            B -> 0

PART2:

Is the resultant grammar is LL(1)?

(a)        TRUE        

(b)        FALSE

SELECT THE CORRECT OPTION.

23 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

23) For each of the following tasks, indicate the earliest stage of the compiler that can always perform that task or detect the situation. Assume the compiler is a conventional one that generates native code (x86, MIPS, etc.) for a language like C++ or JAVA. Use the following abbreviations to identify the stages:

SCAN: Scanner

PARSE: Parser

SEM: Semantics / Type-check

OPT: Optimization

INSTR: Instruction selection & scheduling

REG: Register allocation

RUN: Runtime, that is, when the compiled code is executed

CANNOT: Cannot be done during compilation or execution

(1) Detect that there is an extra “else stmt” clause in the program that is not associated with a previous “if”.  

(2) Detect that in an array reference a[k], the subscript k is out of bounds (i.e., in JAVA where bounds must be checked).  

(3) Guarantee that a particular pointer reference variable p will never be NULL.  

(4) Guarantee that in a pointer reference p.x (p ® x in C/C++) that the value referenced by p will have a field x, assuming that p is not NULL.  

(5) Use x86 addressing modes to calculate x*5 with leal (%eax, %eax, 4), %eax.         

SELECT THE CORRECT OPTION.

24 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

24) Consider the following statements.

STATEMENT1: Hand-written parser is much more powerful than that is generated by a parser generator.

STATEMENT2: LL(inf) is a form of top-down parsing.

STATEMENT3: An LL parser is a deterministic, canonical top-down parser for context-free grammars.

STATEMENT4: An LR parser is a deterministic, canonical bottom-up parser for context-free grammars.

STATEMENT5: LL(*) parsing only backtracks over repeating constructs to resolve conflicts.

WHICH OF THE FOLLOWING STATEMENTS ARE TRUE?

25 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

25) Consider the following statements.

STATEMENT1: SLL(1) is Deterministic grammar.

STATEMENT2: Deterministic parsers are much faster than non-deterministic parser.

STATEMENT3: LL(k) parsing is suitable for natural languages processing.

WHICH OF THE FOLLOWING STATEMENTS ARE TRUE?

26 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

26) Consider the following grammar:

E -> A | B

A -> a | c

B -> b | c

Consider the following statements:

STATEMENT1: Given grammar is LL(1) but not SLR(1).

STATEMENT2: Given grammar is LR(1) but not LL(1).

WHICH OF THE FOLLOWING STATEMENTS IS CORRECT?

27 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

27) Take the following grammar into consideration:

S -> [SX] | a

X -> ε | +SY | Yb

Y -> ε | -SXc

PART1: NULLABLE non-terminal(s)?

(a) S                             (b) X                           

(c) Y                            (d) X and Y

PART2: FIRST(S)?

(a) { a, [ }                     (b) { a, [, ] }                

(c) { a, ], ε }                 (d) { a, ] }

PART3: FIRST(X)?

(a) { ε, +, b }                (b) { ε, +, - }               

(c) { +, -, b, ε }            (d) { +, -, b }

PART4: FIRST(Y)?

(a) { ε, - }                     (b) { ε, +, - }               

(c) { +, -, a, ε }             (d) { ε, a }

PART5: FOLLOW(S)?

(a) { $, +, -, ] }             (b) { $, +, -, ], c, b }    

(c) { $, ], c }                 (d) { $, + }

PART6: FOLLOW(X)?

(a) { ], c }                     (b) { ], c, b }               

(c) { [, b, c }                 (d) { [, ], c, b }

PART7: FOLLOW(Y)?

(a) { ], c, b }                 (b) { ], [, c, b }            

(c) { [, b, c }                 (d) { [, ], a }

PART8: Is this grammar LL(1)?

(a) Yes                         (b) No                                                                                                 

(c) Cannot be answered with information provided.

(d) The LL(1) checker would go into an infinite loop.

SELECT THE CORRECT OPTION.

28 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

28) Consider the following grammar:

S -> Aa | b

A -> a

WHICH PARSING METHOD WORKS MORE EFFICIENT FOR IT?

29 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

29) Consider the following grammar with 2 missing productions.

S -> aS | (1st Missing Production of Grammar)

A -> (2nd Missing Production Of Grammar) | ε

X -> cS | ε

Y -> dS | ε

Z -> eS

We have the FIRST and FOLLOW sets for this grammar.

FIRST(S) = { a, b, c, d, e }

FIRST(A) = { c, d, e, ε }

FIRST(X) = { c, ε }

FIRST(Y) = { d, ε }

FIRST(Z) = { e }

FIRST(a) = { a }

FIRST(b) = { b }

FIRST(c) = { c }

FIRST(d) = { d }

FIRST(e) = { e }

FOLLOW(S) = { $ } U FOLLOW(X) U FOLLOW(Y) U FOLLOW(Z)

FOLLOW(A) = { b }

FOLLOW(X) = FIRST(Y) / ε U FIRST(Z)

FOLLOW(Y) = FIRST(Z)

FOLLOW(Z) = FOLLOW(A)

FOLLOW(a) = FIRST(S)

FOLLOW(b) = FOLLOW(S)

FOLLOW(c) = FIRST(S)

FOLLOW(d) = FIRST(S)

FOLLOW(e) = FIRST(S)

WHAT ARE THESE TWO MISSING PRODUCTIONS OF GRAMMAR IN QUESTION?

(Note: We can only define two productions and recall that X -> A|B is two productions.)

30 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

30) A C identifier consists of zero or more letters, digits, and underscores, in any order, but may not begin with a digit. Which pattern will match one?

31 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

31) Let us consider two LL(1) grammars, each with a single non-terminal, and without ε production. The non-terminal for the first grammar is ‘A’; and the non-terminal for the second grammar is ‘B’. Now, let us consider a third grammar obtained by merging the productions of the two grammars and adding the production S -> A | B.

PART1:

Is it possible to derive the empty string from S in the third grammar?

(a) Yes            (b) No             

(c) Sometimes yes, sometimes no.                                                    

(d) None of the above answer is correct.

PART2:

What is (are) the necessary and sufficient condition(s) that the two original grammars must satisfy, in order to ensure that the third grammar is un-ambiguous?

(a) L(A) intersect L(B) is equal to Phi

(b) L(A) intersect L(B) not equal to Phi

(c) L(A) union L(B) is equal to Phi

(d) L(A) is equal to Phi

(e) Both (b) and (d)

PART3:

What is (are) the necessary and sufficient condition(s) that the two original grammars must satisfy, in order to ensure that the third grammar is LL(1)?

(a) FOLLOW(A) intersect FOLLOW(B) is equal to Phi.             

(b) FIRST(A) intersect FIRST(B) is equal to Phi.

(c) Both (a) and (b).                                      

(d) None of the above answers is correct.

SELECT THE CORRECT OPTION.

32 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

32) Consider the following grammar G.

S -> ABC

A -> Aa | aB

B -> Bb | ε

C -> Cc | ε

PART1:

Consider the following two statements:

STATEMENT1: G can be used to specify an LL(1) parser.

STATEMENT2: ‘a’ is in FIRST(S).

Which of the following statements is correct?

(a) Statement1 and Statement 2 are both TRUE

(b) Statement1 is TRUE, Statement2 is FALSE

(c) Statement1 is FALSE, Statement2 is TRUE

(d) Statement1 and Statement2 are both FALSE

PART2:

Consider the following two statements:

STATEMENT3: ‘c’ is in FIRST(Aa).

STATEMENT4: ‘c’ is in FOLLOW(A).

Which of the following statements is correct?

(a) Statement3 and Statement4 are both TRUE

(b) Statement3 is TRUE, Statement4 is FALSE

(c) Statement3 is FALSE, Statement4 is TRUE

(d) Statement3 and Statement4 are both FALSE

SELECT THE CORRECT OPTION.

33 / 33

Category: COMPILER DESIGN: SET 2 (MCQ) - © 2023 NUUTAN.COM. ALL RIGHTS RESERVED.

33) Consider the following grammar:

E -> A | B

A -> a | c

B -> b | c

Consider the following statements:

STATEMENT1: Given grammar is LL(1).

STATEMENT2: Given grammar is SLR(1).

WHICH OF THE FOLLOWING STATEMENTS IS CORRECT?

RESULTS ARE LOADING - PLEASE WAIT

Your score is

0%

Exit

Get ready to do well on the Advance Compiler Test:

Introducing the Advance Compiler Test. It is a 1-hour online assessment that will push your Compiler Design skills to new heights. Prepare to master the challenge and prove your expertise!

Aim High for Success on the Advance Compiler Test

Score a minimum of 60% in the “Advance Compiler Test” to showcase your prowess in Compiler Design. Aim high and unlock a world of opportunities with this prestigious certification.

Ideal for Students All Over the World, the Advance Compiler Test

Whether you’re studying Compiler Design anywhere in the world or pursuing B.Tech, M.Tech, BCA, or MCA in India, our test is your gateway to academic excellence.

Your Way to Succeed in Competitive Exams Begins with the Advance Compiler Test

Preparing for GATE, NET, SLET, DRDO, or ISRO? The “Advance Compiler Test” is your secret weapon to excel in these competitive exams. Sharpen your skills and stand out from the crowd!

Copyright:

© Nuutan.com: All rights reserved. Unauthorized copying, distribution, or reproduction of this content is strictly prohibited.

Don’t miss this chance to elevate your Compiler Design knowledge. Experience the “Advance Compiler Test” and embark on a journey of knowledge, growth, and success! Experience the “Advance Compiler Test” today and unlock your full potential in Compiler Design. Prepare to conquer challenges, achieve excellence, and open doors to a bright future. Limited slots are available, so act fast to secure your spot!


Discover an Ocean of Educational Resources! We provide a wide variety of learning materials that you can access through our internal links.

  • Nuutan.com is your gateway to a world of information and academic accomplishment. Books in e-book form, multiple-choice question-based online practice tests, practice sets, lecture notes, and essays on a wide range of topics, plus much more!

https://www.nuutan.com/

  • Nuutan.com is your one-stop-shop for all kinds of academic e-books, and it will greatly facilitate your educational path.

https://www.nuutan.com/product-category/k12-cuet-iit-jee-neet-gate-university-subjects

  • Online multiple-choice tests are available for a variety of subjects on Nuutan.com.

https://www.nuutan.com/product-category/multiple-choice-question

  • The Practice Sets on Nuutan.com will improve your performance in any situation.

https://www.nuutan.com/product-category/k12-cuet-iit-jee-neet-gate-cs-btech-mca

  • The in-depth lecture notes available on Nuutan.com will significantly improve your academic performance.

https://www.nuutan.com/product-category/k12-cuet-iit-jee-neet-gate-bca-mca-btech-mtech

  • Show off your writing chops and gain an edge in educational settings and in the workplace with Profound Essays from Nuutan.com.

https://www.nuutan.com/product-category/k12-competitive-exams-essays

  • Nuutan.com is a treasure trove of knowledge thanks to its free academic articles covering a wide variety of subjects. Start your academic engine!

https://www.nuutan.com/nuutans-diary

  • Discover our roots and learn how Nuutan.com came to be. Read up about us on the “About Us” page of our website!

https://www.nuutan.com/about-us

  • Embrace a Future of Knowledge and Empowerment! is the vision of the future that Nuutan.com has unveiled.

https://www.nuutan.com/vision

  • Become an author by publishing your work on the Nuutan.com platform.

https://www.nuutan.com/create-a-publication-with-us


The External Link Related to This Academic Product:

  • GOOGLE BOOKS: Here are a few Google links to help you learn about Compiler Design, including Automata Theory, which is also very helpful for getting a good grasp of Compiler Design.

(1) Mastering Compiler Design: Your Ultimate MCQ Guide to Exam Success

https://books.google.co.in/books/about/Compiler_Design_MCQ_Book.html?id=oZuLEAAAQBAJ&redir_esc=y

(2) Compiler Design MCQs: An Ultimate Practice Book

https://books.google.co.in/books?id=JOZDEAAAQBAJ&pg=PA173&lpg=PA173&dq=nuutan&source=bl&ots=r1dGahQAbC&sig=ACfU3U0eLnUM7zWw3iCP6u9e6bXDIrtxRQ&hl=en&sa=X&ved=2ahUKEwiDivXo3OOAAxVQUGwGHerYD_Q4ChDoAXoECBYQAw#v=onepage&q=nuutan&f=false

(3) Automata Theory – A Step-by-Step Approach (Lab/Practice Work with Solution)

https://books.google.co.in/books/about/Automata_Theory_A_Step_by_Step_Approach.html?id=_XkoswEACAAJ&redir_esc=y

  • YOUTUBE VIDEO:

https://www.youtube.com/watch?v=5yFdTSbqsWE

  • SCRIBD:

https://www.scribd.com/document/489307274/compiler-design-multiple-choice-questions-answers-1-pdf#

  • ACADEMIA:

https://www.academia.edu/36463069/Compiler_mcq

  • SLIDESHARE:

https://www.slideshare.net/SatyamJaiswal54/compiler-design-quiz

  • COURSE HERO:

https://www.coursehero.com/file/129056939/Compiler-MCQ-CS-702pdf/

  • BYJU’S EXAM PREP:

https://byjus.com/gate/compiler-design-mcqs/

  • DOCSITY:

https://www.docsity.com/en/compiler-design-mcq/7356849/

  • OPENGENUS:

https://iq.opengenus.org/compiler-design-mcq/

  • STUDOCU:

https://www.studocu.com/row/document/government-college-university-faisalabad/compiler-construction/compiler-construction-mcq-with-answer-explanation-principles-of-modern-compiler-design-mcq-set-sppu-exam-covid-19-time/13165841

  • GRADUATE APTITUDE TEST IN ENGINEERING (GATE) 2024:

https://gate2024.iisc.ac.in/

  • UGC NET ONLINE (SYLLABUS AVAILABLE ONLINE):

https://www.ugcnetonline.in/NTA_All_R_Syllabus/87/Computer%20Science%20and%20Applications_English%20Only.pdf

  • DRDO (CAREER WEBSITE) – RECRUITMENT AND ASSESSMENT CENTRE (RAC):

https://rac.gov.in/index.php?lang=en&id=0

  • ISRO (CAREER WEBSITE):

https://www.isro.gov.in/Careers.html

  • STATE LEVEL ELIGIBILITY TEST (SLET) – ASSAM NE REGION:

https://sletneonline.co.in/

  • STANFORD ONLINE:

https://online.stanford.edu/courses/soe-ycscs1-compilers

  • IEEE XPLORE (COMPILER DESIGN RESEARCH PAPERS):

https://ieeexplore.ieee.org/document/7814827


As a result of your constant backing and encouragement, Nuutan.com is extremely appreciative and thankful.

These are the various sharing options available for this page.