How to automatically generate boolean calls to your C # source code?
What I would like to generate in method bodies:
private void SomeMethod()
{
Logger.Log("Entering SomeMethod.");
// do stuff here
Logger.Log("Exiting SomeMethod.")
}
Is there a tool that can create this for me? If it doesn't, and I would like to implement it myself, then where to start, which library should I look for recognition methods in the C # source code? Should simple regular expressions be enough?
0
a source to share
4 answers
If you intend to generate code, you must actually perform a complete (and correct) analysis of each code file.
Some searches for "C Sharp Parser" give several possible results: Here And Here
Then you only need to go through the parse tree and add method calls at the beginning and end of each method.
+1
a source to share