Question: lex problem Write a lex program that replaces each word space with a single black ' ', each word newline with a newline character, unless

lex problem

Write a lex program that replaces each word "space" with a single black ' ', each word "newline" with a newline character, unless the word is preceeded by a '\' in which case the '\' is removed and the word is left as is.

Write a lex program that converts the input, a sequence of words separated by whitespace, into the following:

Special cases: The following words or phrases are translated into specific words:

"wahala" becomes "problem", "how na" becomes "how are you", "dat one na grammar" becomes "too complex", "kool tempa" becomes "calm down", "please" is replaced with "abeg", and 'Dis food sweet no be small.' becomes "This meal is delicious."

should be two separate files

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!