Unix

1:

 Which of the following remarks about lex are true?

A.

It generates a C program

B.

It produces a C code that consumes more memory than a C program that can be written separately to accomplish the same task

C.

It produces a C' code that executes slower than a C program that can be%%ritten separately to accomplish the same task

D.

All of these

 

Answer : D

Explanation :

The purpose of lex is to generate a 'C' function yylex, that will recognize any pattern that is given as input to lex, as a regular expression. Also, it can perform the specified action (like deleting, printing, changing to some other pattern, enciphering, etc.) when the specified pattern is matched. It does this by converting regular expression into a non deterministic finite state automata- then a finite state automata—then reduces the number of states in it. lex is a program generator, which means we can write our own code, which functions the same as the lex output. Since lex applies a general set of rules to achieve this, what it generates will not make efficient use of memory and is slower too. Yet it is a powerful tool.that simplifies the programmer's job.

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.