code-generation

Library to parse and check Haskell code?

家住魔仙堡 提交于 2019-12-05 13:53:12
问题 Is there any library in hackage that can parse haskell code and check if it is valid code or not? I'm willing to play a bit with an evolutionary model and I want to check if produced strings of code will compile without having to write them to the disk and run the compiler. Ideally it would be nice to be able to run the code in the strings too, but only checking the validity of the code is ok. If you know about parser libraries (in haskell) that check for other languages (lisp, C,...)it would

What are GCC's passes and invoked programs?

大城市里の小女人 提交于 2019-12-05 12:26:48
It came up in another question : What are the programs and parts called by gcc (particularly when compiling C or C++ ) so that someone might engineer some scheme of intercepting and altering the flow for various custom coding purposes? The compiler binaries are the "compiler driver" (i.e. gcc ), and the compiler itself which also doubles as a preprocessor ( cc1 or cc1plus ). It also invokes the assembler ( as ), and the linker ( ld ). Additionally there's a tool called collect2 that assists during the link process in some cases. If you want to see what the intermediate states and invocations

Nullable value with xsd.exe generated class

☆樱花仙子☆ 提交于 2019-12-05 12:24:16
问题 I have been using xsd.exe to generate a class for deserializing XML into. I have decimal value in the source xsd that is not required: <xs:attribute name="Balance" type="xs:decimal" use="optional" /> The resulting class from xsd generates the following code: private decimal balanceField; [System.Xml.Serialization.XmlAttributeAttribute()] public decimal Balance { get { return this.balanceField; } set { this.balanceField = value; } } Which I note is not nullable. How do I instead generate the

How to run TextTransform.exe from VS 2015 on PC without Visual Studio installed?

旧街凉风 提交于 2019-12-05 11:16:59
I copied TextTransform.exe from PC with VS 2015 Update 3 installed from location C:\Program Files (x86)\Common Files\Microsoft Shared\TextTemplating\14.0\TextTransform.exe to PC without VS 2015 installed. TextTransform.exe is called as a part of build scripts. When I run it I get following error: Error: Exception has been thrown by the target of an invocation. I read the article Code Generation in a Build Process . I tried to copy all dll-s described in section "Configure your machines". But I didn't found the folder $(ProgramFiles)\MSBuild\Microsoft\VisualStudio\v*.0\TextTemplating on my PC

Time to develop an option in Eclipse to modify a Java file source

折月煮酒 提交于 2019-12-05 10:43:24
I'm evaluating the possibility of developing an Eclipse plugin to modify the source code of some Java files. The Eclipse plugin should: add one menu option or context menu option to launch the modification process. add a key binding only alter the UI in that way when an editor has been open on a Java file. the modification process would not open a dialog, or maybe, a very simple one. the modification process would traverse the AST of the Java file and would modify it. Considering that we have no experience with Eclipse plugins and we need spend time in reading docs, how much time do you

Generate C# automatic properties with Codedom

徘徊边缘 提交于 2019-12-05 05:28:43
is there a way Generate C# automatic properties with Codedom or maybe an other set of libreries that i can use ? CodeDom is supposed to be some sort of AST which can be converted to multiple languages (typically C# and VB.NET). Therefore, you'll not find features which are syntactic sugar of a specific language in CodeDom. Rubens Farias No, it's not: C# CodeDom Automatic Property Take a look into this article to get some useful examples You can use CodeSnippetTypeMember class for that purpose. For example: CodeTypeDeclaration newType = new CodeTypeDeclaration("TestType"); CodeSnippetTypeMember

how to generate a Custom Class via t4?

我的未来我决定 提交于 2019-12-05 04:41:29
问题 I am trying to generate the below code via T4. using System; using MyDAL; namspace Test { // Select... public partial class MyCustomer { public int id { get ;set;} public string name { get ;set;} public string surname { get ;set;} public MyCustomer() { } public List<Customer> GetById(int id) { // do something... } } // Delete,Update,Save public partial class MyCustomer { public bool Save(new MyCustomer) { // do something... } public bool delete(int id) { // do something... } public bool

T4 Preprocessed Template Debugging Not Working - Visual Studio 2010 RTM

社会主义新天地 提交于 2019-12-05 04:14:31
I am attempting to debug a preprocessed T4 template and I am not able to step into the class created by running the preprocessed template. I am able to create an instance of the class but as soon as I try to step into while debugging, a new window pops up that says No source available. There is no source code available for the current location. My understanding was that preprocessed templates could be debugged just like a normal c# class, is this not correct? Is there anything in particular that you need to do to be able to step into the class defined by a preprocessed template? Here is a very

Running TextTransform.exe (T4) on a build server

夙愿已清 提交于 2019-12-05 04:14:10
I am trying to setup a process where my T4 templates will be transformed on the build server (Visual Studio is not installed there). I've read all online references, but could not get a clear source that shows how to do this. Specifically, here's the 2 issues i've encountered: TextTransform.exe throws an error about missing DLL: C:\TeamCity\buildAgent\work\AppSettings.tt(0,0) : error CS0006: Compiling transformation: Metadata file 'Microsoft.VisualStudio.TextTemplating.Interfaces.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' could not be found Registering the DLL

x86 instruction encoding tables

为君一笑 提交于 2019-12-05 03:03:14
I'm in middle of rewriting my assembler. While at it I'm curious about implementing disassembly as well. I want to make it simple and compact, and there's concepts I can exploit while doing so. It is possible to determine rest of the x86 instruction encoding from opcode (maybe prefix bytes are required too, a bit). I know many people have written tables for doing it. I'm not interested about mnemonics but instruction encoding, because it is an actual hard problem there. For each opcode number I need to know: does this instruction contain modrm? how many immediate fields does this instruction