MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
A LEX program is compiler by
A
a LEX compiler only
B
a C compiler only
C
a LEX compiler and C compiler
D
none of the mentioned
Explanation: 

Detailed explanation-1: -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.

Detailed explanation-2: -The lex tool takes a lex file and translates it into a pure C file that only contains the C code from the lex file along with code generated from the regular expressions. The C compiler is a tool that takes a C file and translates it into machine code.

Detailed explanation-3: -The lex command helps write a C language program that can receive and translate character-stream input into program actions. To use the lex command, you must supply or write a specification file that contains: Extended regular expressions. Character patterns that the generated lexical analyzer recognizes.

Detailed explanation-4: -The lex command stores the yylex function in a file named lex. yy. c. You can use the yylex function alone to recognize simple one-word input, or you can use it with other C language programs to perform more difficult input analysis functions.

Detailed explanation-5: -Lex reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer in the C programming language.

There is 1 question to complete.