CodeDom Assistant CodeDom的强大工具, 有些BUG修正了下,发到CodePlex,大家有需要的可以看看
2012-06-25 11:36
337 查看
CodeDom Assistant CodeDom的强大工具, 有些BUG修正了下,发到CodePlex,大家有需要的可以看看
一、第一次编译并调整代码 二、修正泛型无法生成CodeDOM代码 后期我会用到这个工具, 如果有需要修改, 会及时修改和改进, 有兴趣的可以参与进来。 http://codedomassistant.codeplex.com/
Generating CodeDom Code By Parsing C# or VB 使用C#或者VB生成CodeDom代码
Introduction
I find writing CodeDom code kind of like writing assembly. It's like cutting the grass with a pair of scissors or unloading a truck load of sand with a spoon. Its long winded, it can be done, but it is tedious. However, there are advantages in using CodeDom.
Now, it would be nice if you could whip up a class in VB or C# and generate the CodeDom code. CodeDom Assistant does this with the help of SharpDevelop's NRefactory Library in conjunction with writing our own CodeDomProvider to generate C# CodeDom code. The code you get will construct a CodeDom compileunit, and it will definitely be ugly. But what can you expect from a machine?
Background
Code Generation can be done using various techniques. In essence, code generation saves time, and enables you to create code using established patterns.
In the world of .NET, one technique is to use CodeDom. It allows you create a document object model of the code. This can by either compiled into an assembly or used to generate code. Every .NET language should have an implementation of a CodeDomProvider to generate code. The problem is that CodeDom does not implement every syntax construct of every language. In essence, it is a subset, but there are enough operations to emulate most language constructs.
Parsing C# or VB is going to be the toughest part, but luckily one of SharpDevelop's little libraries is NRefactory. This has the machinerary required to parse C# or VB code. The key component for us is the CodeDomVisitor class. Sadly, it is only a partial implementation. They implement enough to run SharpDevelop's form generation. I am not saying I have completed the implementation, rather, I have filled most of the holes in the CodeDomVisitor.
The second part is implementing a CodeDomCodeProvider. This will take a CodeDom compile unit and generate C# code that will create a CodeDom compile unit.
License This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
About the old Version Author
raygilbert http://www.codeproject.com/Articles/20597/CodeDom-Assistant http://www.codeplex.com/Download?ProjectName=codedomassistant&DownloadId=381289 http://download.codeplex.com/Download?ProjectName=codedomassistant&DownloadId=381290
About New Version Author MysticBoy http://www.mysticboy.cn
原文:
CodeDom Assistant CodeDom的强大工具, 有些BUG修正了下,发到CodePlex了 http://www.xjiter.com/forum.php?mod=viewthread&tid=86&fromuid=1
一、第一次编译并调整代码 二、修正泛型无法生成CodeDOM代码 后期我会用到这个工具, 如果有需要修改, 会及时修改和改进, 有兴趣的可以参与进来。 http://codedomassistant.codeplex.com/
Generating CodeDom Code By Parsing C# or VB 使用C#或者VB生成CodeDom代码
Introduction
I find writing CodeDom code kind of like writing assembly. It's like cutting the grass with a pair of scissors or unloading a truck load of sand with a spoon. Its long winded, it can be done, but it is tedious. However, there are advantages in using CodeDom.
Now, it would be nice if you could whip up a class in VB or C# and generate the CodeDom code. CodeDom Assistant does this with the help of SharpDevelop's NRefactory Library in conjunction with writing our own CodeDomProvider to generate C# CodeDom code. The code you get will construct a CodeDom compileunit, and it will definitely be ugly. But what can you expect from a machine?
Background
Code Generation can be done using various techniques. In essence, code generation saves time, and enables you to create code using established patterns.
In the world of .NET, one technique is to use CodeDom. It allows you create a document object model of the code. This can by either compiled into an assembly or used to generate code. Every .NET language should have an implementation of a CodeDomProvider to generate code. The problem is that CodeDom does not implement every syntax construct of every language. In essence, it is a subset, but there are enough operations to emulate most language constructs.
Parsing C# or VB is going to be the toughest part, but luckily one of SharpDevelop's little libraries is NRefactory. This has the machinerary required to parse C# or VB code. The key component for us is the CodeDomVisitor class. Sadly, it is only a partial implementation. They implement enough to run SharpDevelop's form generation. I am not saying I have completed the implementation, rather, I have filled most of the holes in the CodeDomVisitor.
The second part is implementing a CodeDomCodeProvider. This will take a CodeDom compile unit and generate C# code that will create a CodeDom compile unit.
License This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
About the old Version Author
raygilbert http://www.codeproject.com/Articles/20597/CodeDom-Assistant http://www.codeplex.com/Download?ProjectName=codedomassistant&DownloadId=381289 http://download.codeplex.com/Download?ProjectName=codedomassistant&DownloadId=381290
About New Version Author MysticBoy http://www.mysticboy.cn
原文:
CodeDom Assistant CodeDom的强大工具, 有些BUG修正了下,发到CodePlex了 http://www.xjiter.com/forum.php?mod=viewthread&tid=86&fromuid=1
相关文章推荐
- CodeDom Assistant CodeDom的强大工具, 有些BUG修正了下,发到CodePlex,大家有需要的可以看看
- 在windows平台工作和开发的伙伴们,发现一个很牛B的公司Sysinternals,提供的一些工具大家可以看看是否可以用
- XNA Game Studio是一套有着强大功能和简单界面的游戏制作平台,游戏开发商和游戏玩家都可以使用这套工具开发针对Windows XP以及Xbox360的游戏,XNA Game Studio分为两种版本,一种是面向初学者的EXPRESS版本,还有一种是面向专业用户的专业版。用户使用EXPRESS版本开发游戏完全免费,并且可以随意在PC上发行,不过用该工具开发的游戏若是在360上网络发行,就需要交纳99美元的年费。
- c语言程序的一个错误,需要注意下的,大家都可以看看哦
- 在网上找了一些j2ee的视频教程,有需要的朋友可以看看
- 几款关于图片和多媒体的JQUERY插件,老外的东西写的就是好,大家可以看看他们写的源代码和调用的简洁性,当然英文如果不好,还是慎入
- 普通管理类程序开发之难度系数、层次之说法,可以看看自己停留在哪个层次,不足之处,请大家一起补充
- 偶然间发现的,大家可以看看
- 强大的 类css 工具:nui - 换肤可以考虑用这个实现的
- NAntGUI 刚刚写了一个生成 NAnt .build 编译文件的小工具。刚刚写完了总体部分,先给大家看看界面(一)
- 普通管理类程序开发之难度系数、层次之说法,可以看看自己停留在哪个层次,不足之处,请大家一起补充
- IAR FOR ARM 各版本,需要的大家可以收藏了
- 改进卷积神经网络,你需要这14种设计模式(转载自机器之心微信号,mark一下当自己网络训练不好时可以看看)
- github上传代码(sourceTree是一个界面化的上传工具,简单易懂,可以初学者去看看)
- 交流一下大家都用什么代码管理工具?每人写一个过程,10万个人就有10万个功能,无比强大****
- 百度用到的Js日历 大家可以看看
- 这难道是CSDN的BUG? 大家帮忙看看哪里有问题
- 开始有些相信星座理论了,处女座的朋友可以看看
- bdf字模工具【MTK中多国语言都需要自己做字模,这个工具可以...】
- 最佳的75个安全工具大家都来看看把