COMPILER DESIGN

LEXICAL ANALYSIS

ROLE OF THE LEXICAL ANALYZER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which one is a lexer Generator?
A
ANTLR
B
DRASTAR
C
FLEX
D
All of these
Explanation: 

Detailed explanation-1: -8. Which one is a lexer Generator? Explanation: ANTLR – Can generate lexical analyzers and parsers. DFASTAR – Generates DFA matrix table-driven lexers in C++.

Detailed explanation-2: -LEX is a program generator designed for lexical processing of character input/output stream. Anything from simple text search program that looks for pattern in its input-output file to a C compiler that transforms a program into optimized code. In program with structure input-output two tasks occurs over and over.

Detailed explanation-3: -A lexical analyzer, also called a lexer, is responsible for breaking a program up into a sequence of lexemes.

Detailed explanation-4: -Lex is a program that generates lexical analyzer.

Detailed explanation-5: -The lexer turns source code into a stream of tokens. This term is actually a shortened version of “lexical analysis”. A token is essentially a representation of each item in the code at a simple level.

There is 1 question to complete.