code-generation

Haskell equivalent of C's __LINE__

Is there a way to get line-number/traceback information in Haskell? (like C's __LINE__ macro or Python's traceback.extract_stack()) That would be of use for me for writing Haskell program that generates C++ code, which would be notated with comments telling which Haskell line is responsible for which C++ line. Haskell example: LINE "...

ms Build engine find existing item or remove duplicate items

I am currently working on an application that generates C# code files and adds them to an existing project. To edit the project I'm using Microsoft.Build.BuildEngine, and loading the exisiting .csproj file into the Project class. csproj = new Project(new Engine(),"3.5"); csproj.Load("/myproject.csproj"); After wich I am able to add...

Program that generates Quartz code

Maybe this isn't a programmer question, but I read about an application for Mac some time ago, where you can make things in an UI, and then the program generates Quartz 2d code for the iPhone from what you've made. Does anyone know what I'm talking about? Very hard to find. :( ...

what does "generate method stub" mean in c#?

I'm trying to call a function, and VS gives me an error (red underline), and i have the option to "generate method stub". What is this? ...

Editing/Modifying a .java file programmatically? (not the .class file)

So, here is a piece of code using CodeModel that generates java code: JCodeModel cm = new JCodeModel(); JDefinedClass dc = cm._class("foo.Bar"); JMethod m = dc.method(0, int.class, "foo"); m.body()._return(JExpr.lit(5)); File f = new File("C:/target/classes"); f.mkdirs(); cm.build(f); This code generates ...

database migration code generator

I want to introduce database migrations into my project and would like to be able to generate my initial migration scripts from the database. I was wondering if there are any code generation tools around to do this? I was thinking of using migrator.net but am happy to use anything so long as I can get a tool to generate code for it. ...

UML modeler for Native C++ with CLI interface Rational Rose Replacement

We have been using Rational Rose 2000 or so for modeling since i guess 2000 or so and were looking to upgrade, however when I looked at the license cost I wondered if it was still the leader in UML for C++ code generation. Further complicating the mater our interface layer is now c++/CLI and we would like to be able to generate that as ...

Is it possible to generate a XSL-FO template from a PDF?

Given a PDF document, is it possible to generate a XSL-FO (FOP) template? Obviously, this would be a one-time thing - the generated template would just be a starting point for creating a proper template that pulls in the appropriate data. For me, the ideal tool for doing so would be a Java-based one and should be executable from the co...

Generate .edmx from class library

I'm attempting to convert a class library consisting of 1300 classes into an entity model. My current approach is to reflect on each type and generate the edmx via T4 template, however its getting kinda messy. Is there a better way to generate this? ...

Engineering techniques to diminish MVVM Driven Development time?

Hi Currently we just start releasing modules for a big project in MVVM but seems like the deliverables are starting to encounter a slowness with this model, such things as the learning curve effort and the fact that mvvm do requires a bit more code than other patterns, What Programming and software engineering techniques do you employ or...

How to get list of objects from BusinessEntity using myGeneration?

I used myGeneration in some projects; I noticed that BusinessEntity keeps the result of the query in a DataTable, But what if the developer wants to get the result as List of objects? To solve this, I made the following modification for my own use. public class BusinessEntity { //.... public DataTable TheDataTable { ...

Is there a code-generator to create DataTable definition block from Excel Work sheet?

Hi, Basically the thing I want to achieve is to have a data-table that I want to use in my unit tests. And when I run my unit tests, I do not want to read any excel file into a data-table -or any call to Db-. So, I would like to have method that returns a data-table with the values that I can use in my test. Is there already any writ...

How to use code generation to dynamically create C# methods?

In order to define a method in C that is callable by Lua it has to match a given signature and use the Lua API to retrieve parameters and return results. I'm writing a C# wrapper of Lua and I'm interested in being able to call arbitrary C# methods without making them follow these conventions. When wrapping in something like D, one might ...

XSD, restrictions and code generation

Hello, I'm working on some code generation for an existing project and I want to start from a xsd. So I can use tools as Xsd2Code / xsd.exe to generate the code and also the use the xsd to validate the xml. That part works without any problems. I also want to translate some of the restrictions to DataAnnotations (enrich Xsd2Code). For ...

Generating Assembly For an x86 Processor

I'm currently working my way through Andrew Appel's Modern Compiler Implementation in Java, and I'm right around the point where I build the low-level intermediate representation. Initially, I had decided to target the JVM and ignore all of the low-level machine stuff, but in the interest of learning things that I don't know much about ...

Reflection.Emit vs CodeDOM

What are some pros/cons for using the Reflection.Emit library versus CodeDOM for dynamically generating code at runtime? I am trying to generate some (relatively complicated) dynamic classes in a system based on metadata available at runtime in XML form. I will be generating classes that extend existing classes in the application assemb...

Accessing source code generated from ASPX/ASCX files

Hi everyone, You've probably noticed that when you debug an error which comes from an ASPX or ASCX file (literally, not from a corresponding code-behind file), ASP.NET displays an error page showing you the source file and the line on which the error occurs. The source file being displayed is automatically generated from parsing the pag...

Subsonic and DB4O

I was recently reading Rob Conery's post about DB4O and it was very interesting. My question is really concerned with class generation and future use of Subsonic and DB4O. As Subsonic looks at the database and then generates classes how would this work for DB4O. Would the classes have to be written by hand and then DB4O would store th...

Which assembler to target?

I'm building a toy compiler as a learning project, and I'm hovering around the code generation phase right now. I found this page describing a host of different assemblers that I could target, and I'd like some recommendations on which to choose. My goal is to optimize my learning experience - to that end, I've tried to make decisions ...

What are CPU registers and how are they used, particularly WRT multithreading?

This question and my answer below are mainly in response to an area of confusion in another question. At the end of the answer, there are some issues WRT "volatile" and thread synchronisation that I'm not entirely confident about - I welcome comments and alternative answers. The point of the question primarily relates to CPU registers a...