parsing C++ header file
-
Does anyone know of any open-source code that will allow me to parse a C++ header file for all the class method signatures?
--- Yours Truly, The One and Only! web: devmentor.org Design, Code, Test, Deploy
-
Does anyone know of any open-source code that will allow me to parse a C++ header file for all the class method signatures?
--- Yours Truly, The One and Only! web: devmentor.org Design, Code, Test, Deploy
Can you more explain about parsing a header file,please?
-
Does anyone know of any open-source code that will allow me to parse a C++ header file for all the class method signatures?
--- Yours Truly, The One and Only! web: devmentor.org Design, Code, Test, Deploy
--Mike-- Visual C++ MVP :cool: LINKS~! CP SearchBar v3.0 | C++ Forum FAQ Dunder-Mifflin, this is Pam.
-
Can you more explain about parsing a header file,please?
i am looking for simple code that will give me a list of all the class method signatures. i want to use these signatures for a tool to generate mock classes for a unit testing tool i have developed.
--- Yours Truly, The One and Only! web: devmentor.org Design, Code, Test, Debug
-
--Mike-- Visual C++ MVP :cool: LINKS~! CP SearchBar v3.0 | C++ Forum FAQ Dunder-Mifflin, this is Pam.
i was just thinking about this project! i wonder if they have a few simple classes i can use to get a parse tree of only the method signature? ... i was looking for something more simple, don't got the energy to dive into larger projects and start ripping out what i need :laugh: possibly i can ask the developers to point me to the files i need. thanks
--- Yours Truly, The One and Only! web: devmentor.org Design, Code, Test, Debug
-
i was just thinking about this project! i wonder if they have a few simple classes i can use to get a parse tree of only the method signature? ... i was looking for something more simple, don't got the energy to dive into larger projects and start ripping out what i need :laugh: possibly i can ask the developers to point me to the files i need. thanks
--- Yours Truly, The One and Only! web: devmentor.org Design, Code, Test, Debug
just a guess, but what are you trying to accomplish here ? forget this, i've just seen your reply[^] to Hamid.
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
Can you more explain about parsing a header file,please?
What part of "parse a C++ header file for all the class method signatures" is troubling you? That's fairly self-explanatory, yes?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
What part of "parse a C++ header file for all the class method signatures" is troubling you? That's fairly self-explanatory, yes?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
Yeah I see. BTW(I saw your signature they are nice sentences).
-
i was just thinking about this project! i wonder if they have a few simple classes i can use to get a parse tree of only the method signature? ... i was looking for something more simple, don't got the energy to dive into larger projects and start ripping out what i need :laugh: possibly i can ask the developers to point me to the files i need. thanks
--- Yours Truly, The One and Only! web: devmentor.org Design, Code, Test, Debug
DevMentor.org wrote:
i was looking for something more simple
Unfortunately, this is not a simple problem.The parser has to be able to handle everything that the CPP language can throw at it, and has to start with trigraph conversion and pre-processing. If all you need is a tool to fish methods out of classes, something simpler may do. Kernighan and Ritchie give an excelent example of a function declaration parser in their book which you can possibly expand upon for CPP. But, then again, you need to know the names of the types. They are often declared in previously included headers. Maybe hard code in a basic symbol table? Regards and success :doh:
Bram van Kampen
-
DevMentor.org wrote:
i was looking for something more simple
Unfortunately, this is not a simple problem.The parser has to be able to handle everything that the CPP language can throw at it, and has to start with trigraph conversion and pre-processing. If all you need is a tool to fish methods out of classes, something simpler may do. Kernighan and Ritchie give an excelent example of a function declaration parser in their book which you can possibly expand upon for CPP. But, then again, you need to know the names of the types. They are often declared in previously included headers. Maybe hard code in a basic symbol table? Regards and success :doh:
Bram van Kampen
Thanks Bran for your reply. I have found a simply tool that someone from the Doxygen-Develop mailing list said I could use, it's called gcc-xml and designed for tool developers like me who don't want to read the "Red Dragon" book on parsing :)
--- Yours Truly, The One and Only! web: devmentor.org Design, Code, Test, Debug