All Exams Test series for 1 year @ ₹349 only
Question

What is the output of a lexical analyzer?

The correct answer is

Sequence of tokens

This is the sequence of tokens that the next phase, the parser, will use. This is the output of the parser (syntactic analyzer), which takes the sequence of tokens as input. Therefore, the correct output of a lexical analyzer is a sequence of tokens .

Was this answer helpful?

Important Questions from Lexical Analysis

  1. Arrange the given compilation process in the correct order.

    a. Linking

    b. Assembling

    c. Compiling

    d. Pre-processing

  2. Which of the following are applications of symbol table ?

    (A) Storage allocation

    (B) Checking type compatability

    (C) Suppressing duplicate error messages

    Choose the correct answer from the options given below:

  3. Consider the following C statements:
    char *str1 = "Hello; /* Statement S1 */
    char *str2 = "Hello;"; /* Statement S2 */
    int *str3 = "Hello"; /* Statement S3 */

    Which of the following options is/are correct?
  4. Which ONE of the following statements is FALSE regarding the symbol table?

  5. A lexical analyzer uses the following token definitions
    • $letter \rightarrow [A-Z a-z]$
    • $digit \rightarrow [0-9]$
    • $id \rightarrow letter(letter \mid digit)^*$
    • $number \rightarrow digit^+$
    • $ws \rightarrow (blank \mid tab \mid newline)^+$

    For the string given below,

    $x1 \quad 23mm \quad 78 \quad y \quad 7z \quad zz5 \quad 14A \quad 8H \quad AaYcD$

    the number of tokens (excluding $ws$) that will be produced by the lexical analyzer is __________. (answer in integer)
Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App