Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions