locked
Parsing .NET code RRS feed

  • Question

  • User-1793822101 posted
    I have a low priority project to analyse code. Before I go any further I'd like to know how I access code parsers for .NET languages. They're obviously in there already by a (quick) look hasn't shown how I get at them and what format the output is. For languages my interest is VB.NET and C# (JScript.NET would also be welcome). Anyone got insights into this?
    Sunday, September 7, 2003 9:55 PM

All replies

  • User-1363174918 posted
    You can't really access parser that is inside the compiler, but you do can access language code model. However, you will need VS to use the code model. Have a look at Discovering Code with the Code Model
    Tuesday, September 16, 2003 2:49 AM
  • User-1793822101 posted
    Thanks Mikhail. I had a look at the article. It appears that it can give me things like a (partial) class diagram but not code structure within a function. It's the latter I'm really after. I then did a quick search on the web. In a few minutes search I found an open source C# parser but I wrote it off as not worth a detailed look. I'll push this idea behind the back burner.
    Tuesday, September 16, 2003 6:02 PM
  • User216710842 posted
    i am interest in this problem. i can not solve this problem so i use plug-in to extend my program instead of script.
    Tuesday, October 21, 2003 10:18 AM
  • User763059395 posted
    You might want to takea look at the CodeDOM. I couldn't really tell if you wanted to analyse binary files or just plain code. Either way with a good amount of work and know how you can leverage Reflection and the CodeDOM to help you do what you want. The problem is that many of the Parsers for the code haven't been implimented in the CodeDOM. There are a couple Open Source Projects that are trying to make a C# CodeDOM over on SF. Also if you want to use a Parser you can always look at the Rotor code or the Mono code and use that some how. Either way the article is at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsapplicationclassenablevisualstylestopic.asp . Hope it works out for you.
    Friday, January 16, 2004 12:47 PM