Q.1. Write a Lex input file that will produce a scanner that capitalizes all comments in a C program. Moreover

Q.1. Write a Lex input file that will produce a scanner that capitalizes all comments in a C program. Moreover after replicating its input program in the terminal (or in a file), the scanner should append the total number of comments to its output. Your scanner should be able to accept optional command line arguments to indicate the input and output filenames. Please consider using toupper(char c) from
to convert to uppercase.

Q.2. Write a rule in Lex to print integer numbers that are multiple of five. The numbers are allowed to have an optional sign (+/-). You are not neither allowed to convert the matched strings into integers, nor to use the modulus operator (
%) in your rule. And
Give only the rule section of a Lex input file for a scanner that prints only all the letters in its input on screen, and ignores everything else.

 

"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"