Search Header Logo

Compiler and Lexical Analysis Quiz 2

Authored by sameer tamboli

English

Professional Development

Compiler and Lexical Analysis Quiz 2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

17 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the primary function of a compiler?

To execute the source code directly

To debug the source code

To translate source code into target code

To optimize the source code

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which phase of the compiler is responsible for lexical analysis?

Synthesis phase

Code generation phase

Semantic analysis phase

Analysis phase

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What does a preprocessor do?

Generates machine code

Processes macros and includes files

Optimizes the code

Handles semantic errors

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the purpose of the semantic analysis phase?

To optimize the code

To generate intermediate code

To gather type information and check for semantic errors

To check for syntax errors

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is NOT a function of the lexical analyzer?

Performing syntax analysis

Skipping white spaces and comments

Producing tokens

Reading input characters

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is a token in the context of lexical analysis?

A sequence of characters that forms a meaningful word

A type of error in the source code

A command for the parser

A data structure for storing identifiers

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the role of the symbol table in a compiler?

To store the source code

To record identifiers and their attributes

To generate machine code

To optimize the code

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?