Self Studies

Compiler Design...

TIME LEFT -
  • Question 1
    1 / -0

    If C is a programming language, then which of the following cannot be a token produced by lexical analysis phase?

  • Question 2
    1 / -0

    If below given options are written in C language, then which of the following code can produce lexical error?

  • Question 3
    1 / -0

    Which of the following statements is/are TRUE about the lexical analyzer?

    I. It reads the input characters and produces a sequence of tokens that the parser uses for syntax analysis.

    II. Lexical analyzer removes comments and white spaces in the form of blank, tab, and newline characters.

    III. It correlates error messages from the compiler with the source program.

  • Question 4
    1 / -0

    The number of tokens in the following C program

    int main() {
    float p  = 2.33;
    double q = 19;
    if(p != q)
    printf("p = %f", p++);
    else
    printf("q = %lf", ++q);

    }

    What is the number of tokens?

  • Question 5
    1 / -0

    Consider the below given table in which regular expression is mapped to unique token:

    Regular ExpressionToken
    p*(p | q)p*3
    qp*1
    p+(r | q) pq2

    What will be the output when the string ''pppqppqprpqp" is scanned by the lexical analyzer if the analyzer outputs the token that matches the longest possible prefix if it is mandatory to use all the tokens at least once?

  • Question 6
    1 / -0

    Consider the following statements:

    S1: New entries are created in symbol table for each new identifier during lexical analysis.

    S2: Lexical analyzer detects ill-formed numeric literals and input characters that are not in the source language.

    Which of the following is true?

  • Question 7
    1 / -0

    Consider the below-given code written in C language

    #include<stdio.h>

    int main()

    {

    int k  = 20;

    whlie(--k)

    printf(“GATE CS 2021\n”);

    }

    Identity the compiler’s response about the above-given code while creating the object- module

  • Question 8
    1 / -0

    A particular BNF definition for a “word” is given by the following rules.

    <word>  :: = <letter> | <letter><charpair> | <letter><intpair>

    <charpair>  :: = <letter><letter> | <charpair><letter><letter>

    <intpair>  :: = <integer><integer> | <intpair><integer><integer>

    <letter> :: = A | B | C | ….. | Y | Z

    <integer> :: = 0 | 1 | 2 | …. | 9

    Which of the following lexical entries can be derived from < word >?

    I. TESTBOOK

    II. TTP

    III. T20

Submit Test
Self Studies
User
Question Analysis
  • Answered - 0

  • Unanswered - 8

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
Submit Test
Selfstudy
Selfstudy
Self Studies Get latest Exam Updates
& Study Material Alerts!
No, Thanks
Self Studies
Click on Allow to receive notifications
Allow Notification
Self Studies
Self Studies Self Studies
To enable notifications follow this 2 steps:
  • First Click on Secure Icon Self Studies
  • Second click on the toggle icon
Allow Notification
Get latest Exam Updates & FREE Study Material Alerts!
Self Studies ×
Open Now