开发者

How to parse through a C/C++/C# project and write all packages/classes/methods into a database? [closed]

开发者 https://www.devze.com 2023-01-21 18:17 出处:网络
Closed. This quest开发者_如何学运维ion does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This quest开发者_如何学运维ion does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 8 years ago.

Improve this question

For my new application I would like to parse another C, C++ or C# project, so that i can later display the graphical representation of all the classes in this project.

So I thought that its a good approach to use a database with the following tables to store the necessary information:

TablePackages:
id | name | parentID

TableClasses:
id | name | packageID | sourceCodeID

TableSourceCode:
id | members | constructors | methods | classID

But now, how can I parse in my C# application the source files of other projects? Are there any libraries available or where should I start?

Should I even rethink my approach and choose a completely different one?


For C#, you can compile it and use reflection to get the list of all classes/properties/methods. For C/C++, you would perhaps need to implement a parser in some form yourself.

0

精彩评论

暂无评论...
验证码 换一张
取 消