473,378 Members | 1,482 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

CodeDOM: Parsing and Generating C#

Is it possible to use CodeDOM to parse a project's C# source files, and then
use it to generate the source from the given structures in order to reformat
all your code?
Nov 15 '05 #1
4 5225
Ignore that, it seems that CreateParser isn't implemented in this ver of
..net so that won't work.

"John Wood" <jw****@spaam.optonline.net> wrote in message
news:N7********************@news4.srv.hcvlny.cv.ne t...
Is it possible to use CodeDOM to parse a project's C# source files, and then use it to generate the source from the given structures in order to reformat all your code?

Nov 15 '05 #2
Hi John,

You are right - the parser is not exposed to the general public (but it is
of course implemented - how the C# compiler would work otherwise? ;-) )

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"John Wood" <jw****@spaam.optonline.net> wrote in message
news:Kv*********************@news4.srv.hcvlny.cv.n et...
Ignore that, it seems that CreateParser isn't implemented in this ver of
.net so that won't work.

"John Wood" <jw****@spaam.optonline.net> wrote in message
news:N7********************@news4.srv.hcvlny.cv.ne t...
Is it possible to use CodeDOM to parse a project's C# source files, and

then
use it to generate the source from the given structures in order to

reformat
all your code?



Nov 15 '05 #3
Hi John

If you intend to use this information at design time you can use the VS
CodeModel. This only works through VS however.

--
Gabriel Esparza-Romero, Visual C# Team
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Nov 15 '05 #4

"John Wood" <jw****@spaam.optonline.net> wrote in message
news:N7********************@news4.srv.hcvlny.cv.ne t...
Is it possible to use CodeDOM to parse a project's C# source files, and then use it to generate the source from the given structures in order to reformat all your code?


This C# reformatter can reformat all your code without going through all
that hassle:
http://www.semdesigns.com/Products/F...ers/index.html
--
Ira D. Baxter, Ph.D., CTO 512-250-1018
Semantic Designs, Inc. www.semdesigns.com
Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ron Bullman | last post by:
Hi, I havent been able to find any documentation about @ in the CodeDom context. The problem is when generating C# code from CodeDom it will associate a @-tag with all C# specific types. Why?...
3
by: Ramiro Calderón | last post by:
Hi list, Does anybody know if there is a way to build a CodeDom Graph given a some *.cs file? I know how to create a *.cs file from a CodeDom graph, and I couldn't find something alike in the...
0
by: Sherif ElMetainy | last post by:
Hello I am making an application that generates source code. I am facing some problems. 1- How can I generate code that uses the c# 'params' keyword to specify multiple arguments? I tried 2...
3
by: Tapas | last post by:
Hi, Generating a .cs file using CodeDom. It generates the class fine. But i have few queries about class generation. 1. How to create a protected member? By default it generates a private...
0
by: Saradhi | last post by:
Hi All , I am using the Code model for Generating the VB code on the Fly. I am able to generate a new class with the Variables, Fields and Methods I want. Now What I want is the facility to...
1
by: Russell Mangel | last post by:
Sorry about the crosspost, I posted in the wrong group... I am using C# CLR 2.0 CodeDom: I need to create the following array: SqlParametersqlParameters={ new SqlParameter("@invID",...
0
by: Fred Heida | last post by:
Hi, i would like to beable to analyse a c# file out side of th IDE using the CodeDom classes .. so i coded StreamReader sw = new StreamReader("Class1.cs"); CodeDomProvider p =...
0
by: deostroll | last post by:
It is said that you can generate ASP.NET code. Can you clarify this statement. I don't see how you can do this? ASP.NET apps come in 2 parts - the code file and html page. The code file contains...
1
by: Niels Ull | last post by:
Hi! I'm using .Net 2.0 and C#, and I'm trying to generate code for build time AOP. But I cannot find out how to generate an anonymous delegate. E.g. generating code like this: class...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.