I am working on a Reverse Engineering school project, which requires to translate manipulate AST of compiled C# project. I have seen the post on "Translate C# code into AST?" in this website, but it doesn't look like the one I am looking for. According to what I knew, currently C# doesn't provide a library class that does sth like that for Java: http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.cdt.doc.isv/reference/api/org/eclipse/cdt/core/dom/ast/ASTVisitor.html If there is such library class in C#, everything here is solved.
I have consult with someone, and here are the possible solutions. But I have problems with working out on the solutions as well. 1) Find another compiler that provides a library which allows its AST to be expose for manipulation. But I can't find a compiler like that. 2) Use ANTLR Parser Generator to come out with my own compiler that does that (tt will be a much more difficult and longer process). The download there provides sample grammars for different languages but not C# (it has grammars written in various languages including C# but not to produce C# grammar). Hence the problem is I can't find C# grammar.
What is shortest and fastest way to approach this issue? If I really hv to take one of the alternative above, how should I go abt solving those problems I faced.
Would be very thankful to u if u can help me to get my problem solved!