COMPILER DESIGN

SYNTAX ANALYSIS

ROLE OF THE PARSER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which tool is used as scanner generator in compiler?
A
LEX
B
YACC
C
SDT
D
Finite Automata
Explanation: 

Detailed explanation-1: -Description. flex is a tool for generating scanners: programs which recognized lexical patterns in text. flex reads the given input files, or its standard input if no file names are given, for a description of a scanner to generate.

Detailed explanation-2: -As noted, a program uses the lex-generated scanner by repeatedly calling the function yylex() . This name is convenient because a yacc-generated parser calls its lexical analyzer with this name.

Detailed explanation-3: -This division into units (called tokens) is known as lexical analyzer or LEXING. LEX helps by taking a set of descriptions of possible tokens n producing a routine called a lexical analyzer or LEXER or Scanner.

Detailed explanation-4: -8. Which one is a lexer Generator? Explanation: ANTLR – Can generate lexical analyzers and parsers.

Detailed explanation-5: -Scanner Generator generates lexical analyzers from the input that consists of regular expression descriptions based on tokens of a language. It generates a finite automaton to identify the regular expression. Example: LEX is a scanner generator provided by UNIX systems.

There is 1 question to complete.