Write a Lex input file that will produce a scanner that capitalizes

Question # 00761564 Posted By: dr.tony Updated on: 05/15/2020 01:02 PM Due on: 05/15/2020
Subject General Questions Topic General General Questions Tutorials:
Question
Dot Image

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. 

Dot Image
Tutorials for this Question
  1. Tutorial # 00762078 Posted By: dr.tony Posted on: 05/15/2020 01:03 PM
    Puchased By: 3
    Tutorial Preview
    The solution of Write a Lex input file that will produce a scanner that capitalizes...
    Attachments
    Write_a_Lex_input_file_that_will_produce_a_scanner_that_capitalizes.ZIP (18.96 KB)

Great! We have found the solution of this question!

Whatsapp Lisa