Computer Science Fundamentals Operating Systems Objective
Mar 10, 2013

How many remarks about lex are true?

Choose the correct answer:
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
Detailed 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.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback