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
Get step-by-step solutions from verified subject matter experts
