I'm working on a VB.NET codebase that uses legacy naming conventions vaguely similar to Hungarian Notiation, for instance:
- A member string Test would be mstrTest
- A function-scope int Test would be lintTest
- A parameter Object Test would be pobjTest
In order to verify that variables are being named correctly, and to work out a solution to each non-conforming variable name, I need to find any instance of variables in the codebase, along with their scope and type.
I've done some tests using regexes to look for Functions and Subs, but instances of class member variables (for instance) would be difficult to do in this way, not to mention that parsing code with Regexes feels incorrect.
Is there a way (in C#) that I could create some kind of structured hierarchy from the codebase without having to start from scratch, or a better way to achieve this tack in general?
Apologies if my explanation is wrong/vague, I've not attempted to parse a language before.