Describe how to make the following modifications to the Lex program of Fig. 3.23:
Write a Lex program that copies a file, replacing each non empty sequence of white space by a single blank
Write a Lex program that copies a C program, replacing each instance of the keyword f loat by double.。
Write a Lex program that converts a file to "Pig latin." Specifically, assume the file is a sequence of words (groups . of letters) separated by whitespace. Every time you encounter a word:
All nonletters are copied int act to the output.
In SQL, keywords and identifiers are case-insensitive. Write a Lex program that recognizes the keywords SELECT, FROM, and WHERE (in any combination of capital and lower-case letters) , and token ID, which for the purposes of this exercise you may take to be any sequence of letters and digits, beginning with a letter. You need not install identifiers in a symbol table, but tell how the "install" function would differ from that described for case-sensitive identifiers as in Fig. 3.23.