Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8079591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:09:18+00:00 2026-06-05T16:09:18+00:00

I need to write a C++ code coverage program that takes in another C++

  • 0

I need to write a C++ code coverage program that takes in another C++ program (given in a file) and enhances or adds below to each of its statement a call to a function that increases a counter. But, I need to use a different counter for each type of expression (i.e. I need to figure how many expressions there are of each type). For this I need to figure the type of each C++ expression. IMO I need to use a parser API to parse each line to get its type.
Do you see a better solution?
Otherwise, where can I find parsing API?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T16:09:20+00:00Added an answer on June 5, 2026 at 4:09 pm

    A “parser” API won’t give you type information. It will at best give you access to ASTs.

    You need a full C++ front end, that can parse C++ code, do name and type resolution, and can compute the type, literally, of each expression. On top of that, you need to insert the instrumentation that you want, and then spit out compilable source code.

    Our DMS Software Reengineering Toolkit with its C++ Front End has all the capabilities necessary to do this.

    DMS has been used to build test coverage and profiler tools for C++ (and many other languages); you can even download and try one to see what they are like. You may find this paper on building test coverage tools with DMS interesting as a baseline for what you want to do. Your variant needs the type inference but otherwise it isn’t a lot different.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to write some code that would loop though all rows of a
I need to write some code (in any language) to process 10,000 files that
I need to write a delegate function that can 'wrap' some while/try/catch code around
Both my Rails model and controller code need to write files to the file
I need to write code to do some realtime processing that is fairly computationally
I have a need to write code that will prorate a value across a
I need to write code in C that will indicate and notify me when
I need to write code that reads the corflags of a .net assembly without
I have an HTML page containing a flash file, I need to write code
I need to write code to download and run a program, e.g. notepad++ (npp.5.9.3.Installer.exe)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.