COMPILER DESIGN

TOOLS AND TECHNIQUES FOR COMPILER DESIGN

MISCELLENOUS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
LEX compiler generates ____
A
yy.lex.c
B
lex.yy.c
C
executable code
D
object code
Explanation: 

Detailed explanation-1: -Firstly lexical analyzer creates a program lex.1 in the Lex language. Then Lex compiler runs the lex.1 program and produces a C program lex.yy.c.

Detailed explanation-2: -Yacc (Yet Another Compiler Compiler) is a tool used to create a parser. It parses the stream of tokens from the Lex file and performs the semantic analysis. Yacc translates a given Context-Free Grammar (CFG) specifications into a C implementation y.

Detailed explanation-3: -LEX is one such lexical analyzer generator which produces C code based on the token specifications. This tool has been widely used to specify lexical analyzers for a variety of languages. We refer to the tool as Lex Compiler, and to its input specification as the Lex language.

Detailed explanation-4: -Use the lex program to change the specification file into a C language program. The resulting program is in the lex. yy. Use the cc command with the-ll flag to compile and link the program with a library of lex subroutines. The resulting executable program is in the a.

There is 1 question to complete.