Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Test  >  GATE Computer Science Engineering(CSE) 2027 Mock Test Series  >  Test: Lexical Analysis- 2 - Computer Science Engineering (CSE) MCQ

GATE Computer Science Engineering(CSE) 2027 Test: Lexical Analysis- 2 Free


MCQ Practice Test & Solutions: Test: Lexical Analysis- 2 (15 Questions)

You can prepare effectively for Computer Science Engineering (CSE) GATE Computer Science Engineering(CSE) 2027 Mock Test Series with this dedicated MCQ Practice Test (available with solutions) on the important topic of "Test: Lexical Analysis- 2". These 15 questions have been designed by the experts with the latest curriculum of Computer Science Engineering (CSE) 2026, to help you master the concept.

Test Highlights:

  • - Format: Multiple Choice Questions (MCQ)
  • - Duration: 45 minutes
  • - Number of Questions: 15

Sign up on EduRev for free to attempt this test and track your preparation progress.

Test: Lexical Analysis- 2 - Question 1

In a two pass assembler pseudo code EQU is to be evaluated during

Detailed Solution: Question 1

In 2-pass assembler during pass-1 pseudo code EQU is to be evaluated.

Test: Lexical Analysis- 2 - Question 2

Pick the functions which are completely performed in pass 1

Detailed Solution: Question 2

Operation performed during pass-1 in 2-pass compiler:
1. Processing the DB pseudo-op.
2. Updating the location counter.
3. Processing of EQU pseudo-op.
4. Processing of DS pseudo-op.

Test: Lexical Analysis- 2 - Question 3

in a context-free grammar

Detailed Solution: Question 3

The context free grammar is represented as
S → X

where S∈ V(Single symbol non-terminal)

D → (V ∪ T ) * (Any number of terminal and nonterminals)

Test: Lexical Analysis- 2 - Question 4

If two finite state machines M and N are isomorphic, then

Test: Lexical Analysis- 2 - Question 5

In an incompletely specified automata

Detailed Solution: Question 5

In incomplete automata some states have no transition on some tokens.

Test: Lexical Analysis- 2 - Question 6

Consider the following issues:
1. Simplify the phases.
2. Compiler efficiency is improved.
3. Compiler works faster.
4. Compiler portability is enhanced.

Which is/are true in context of lexical analysis?

Detailed Solution: Question 6

Lexical analysis consists of the phases that
(i) Simplify the subsequent phases by the help of tokens instead of arbitrary elements.
(ii) Since interrelated elements are converted to stream of tokens hence compiler efficiency is improved as no arbitrary storage or value is to be checked independently.
(iii) Computer portability is enhanced.

Test: Lexical Analysis- 2 - Question 7

If G is a grammar with productions

S → SaS | aSb | bSa | SS | ∈

Where S is the start variable. Then which one of the following strings in not generated by G?

Detailed Solution: Question 7

Grammar Production: S → SaS | aSb | bSa | SS | ∈

Option 1: String: abab

S → aSb

S → abSab 

S → ab∈ab

S → abab

So, abab can be generated by the given grammar.

Option 2: String: aaab

S → SS

S → SaSS 

S → SaSaSS 

S → aaaSbS 

S → aaa∈bS 

S → aaa∈b∈ 

S → aaab

Option 3: String:  abbaa

S → SS

S → aSbS 

S → a∈bS 

S → abbSa  

S → abbSaSa 

S → abb∈aSa

S → abba∈a

S → abbaa  

All three abab, aaab and abbaa are generated by the given grammar.

Only babba can’t be generated.

Test: Lexical Analysis- 2 - Question 8

Given two DFA’s M1, and M2. They are equivalent if

Detailed Solution: Question 8

Given two DFA’s M1 and M2. They are equivalent if the language generated by them is same i,e, L(M1) = L(M2)

Test: Lexical Analysis- 2 - Question 9

For the string aabbaa give the derivation tree using grammar:

G = {{S, A}, {a, b}, {S → aAS, S→ a, A → SbA, A→  SS, A → ba}, S}

Detailed Solution: Question 9

S → aAS, S→ a, A → SbA, A→  SS, A → ba}, S

Input: aabbaa

Test: Lexical Analysis- 2 - Question 10

Consider a program P that consists of two source modules M1 and M2 contained in two different files. If M1 contains a reference to a function defined in Mthe reference will be resolved at

Detailed Solution: Question 10

Modules may be compiled separately and all linking between references is made at link time.

Test: Lexical Analysis- 2 - Question 11

Consider line number 3 of the following C-program.
int main ()  { /* Line 1 */ 
int i, n; /* Line 2 */
fro (i = 0, i < n, /+ + ); /* Line 3 */
}

Identify the compiler’s response about this line while creating the object - module

Detailed Solution: Question 11

Error is underlined function fro()
Which is a syntactical error rather than lexical.

Test: Lexical Analysis- 2 - Question 12

Consider the following grammars:

Which of the following statements is not true?

Detailed Solution: Question 12

Here grammar, G2 is not ambiguous 

Because there exist only one parse tree.

Test: Lexical Analysis- 2 - Question 13

Hash tables can contribute to an efficient average case solution for

Detailed Solution: Question 13

Hash table can contribute to an efficient average case solution for symbol table look up problem

Test: Lexical Analysis- 2 - Question 14

Consider the grammar:

Which of the following sentence can be derived by this grammar?

Detailed Solution: Question 14

S — ABc — abc

Test: Lexical Analysis- 2 - Question 15

Which of the following is not a regular grammars?
 

Detailed Solution: Question 15

Mixup notation of left linear and right linear grammar is not allowed in regular grammar.

56 docs|215 tests
Information about Test: Lexical Analysis- 2 Page
In this test you can find the Exam questions for Test: Lexical Analysis- 2 solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Lexical Analysis- 2, EduRev gives you an ample number of Online tests for practice
Download as PDF