COMPILER DESIGN

LEXICAL ANALYSIS

ROLE OF THE LEXICAL ANALYZER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The function ____ is automatically generated by the Lex when it is provided with a .l file
A
flex()
B
yylex()
C
lex()
D
nnlex()
Explanation: 

Detailed explanation-1: -If yywrap() returns a non-zero value (indicating true), yylex() terminates the scanning process and returns 0 (i.e. “wraps up”). If the programmer wishes to scan more than one input file using the generated lexical analyzer, it can be simply done by setting yyin to a new input file in yywrap() and return 0.

Detailed explanation-2: -lex also creates two important external data objects: A string named yytext. This string contains a sequence of characters making up a single input token. The token is read from the stream yyin, which, by default, is the standard input (stdin).

There is 1 question to complete.