473,386 Members | 1,654 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

parsing a c++ header file and extracting

I was wondering if someone could guide me or give me few pointers on how to go about doing this.

parsing a C++ header file. While parsing , I want to extract enumerations from the file. I would like to store the extracted enumerations on a different file.

Appreciate your help
Jul 10 '07 #1
3 2085
weaknessforcats
9,208 Expert Mod 8TB
You aren't thinking of having those enumerations in two places are you? I mean, you are going to remkove them from the original file, yes?

Other than that, extracting an enum can be harder than it looks since the enum may be a struct, class or namespace member.

Have you an example of what you are proposing?
Jul 10 '07 #2
You aren't thinking of having those enumerations in two places are you? I mean, you are going to remkove them from the original file, yes?

Other than that, extracting an enum can be harder than it looks since the enum may be a struct, class or namespace member.

Have you an example of what you are proposing?



I was thinking of just copying the enumerations into a different file. I wasn't thinking of removing it.

Can you suggest an easy way of doing it. It's kind of urgent
Jul 10 '07 #3
weaknessforcats
9,208 Expert Mod 8TB
Choice 1:

#include the original file.

Choice 2:

Remove the enumerations and put then in a separate file. The #include the enumerations in the original header and then you can #include just the enumerations elsewhere.

Do anything excapt make a copy of the enums. You will never keep the copies in sync.

All of your headers use inclusion guards, yes?? You know:

#ifndef MYHEADER
#define MYHEADER

......header file contents here

#endif

If not, put them in.
Jul 11 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: dont bother | last post by:
Hi, I have written this small piece of code. I am a brand new player of Python. I had asked some people for help, unfortunately not many helped. Here is the code I have: import email import...
9
by: gov | last post by:
Hi, I've just started to learn programming and was told this was a good place to ask questions :) Where I work, we receive large quantities of data which is currently all printed on large,...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
9
by: Paulers | last post by:
Hello, I have a log file that contains many multi-line messages. What is the best approach to take for extracting data out of each message and populating object properties to be stored in an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.