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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started