code-generation

How can I automatically add existing items to a Visual Studio project?

I have a tool which dynamically generates .xaml and .xaml.cs files and puts them in the appropriate Visual Studio directory. To add them to the project, I have to then: right-click on that directory choose "add existing item" navigate to the matching directory on the hard drive select the two files that were created click ok Is the...

Dynamic code generation

I am currently developing an application where you can create "programs" with it without writing source code, just click&play if you like. Now the question is how do I generate an executable program from my data model. There are many possibilities but I am not sure which one is the best for me. I need to generate assemblies with classes...

Can anyone recommend a NHibernate generating tool?

I want to auto generate .hbm mapping files from my domain objects ...

Replacing // comments with /* comments */ in PHP

Hi, I'm creating a CSS generator in PHP which uses CSSX (yep, they are my idea) files (with a special syntax). One feature is 'short comments': body { font-family: Georgia; //I really like this font! } Now I want to replace this comment with a /* ... */ comment, so the output is like this: body { font-family: Georgia; /*I re...

What is the requires/provides design pattern used by the T4 RequiresProvidesDirectiveProcessor class?

The MSDN Library documentation for the RequiresProvidesDirectiveProcessor class in the Microsoft.VisualStudio.TextTemplating namespace refers to a design pattern called "requires/provides". What is this design pattern? "The abstract base class for a directive processor that defines and implements a design pattern called requires/...

Domain Language: What is the best way to express?

One of my client sent me a requirement document and while reading that document there was a flash came in my mind. I started rewriting that big document similar like below. Do you think, an automated tool can generate a data model and rules by running through this. Say, if any client communicate their requirement in this approach, it wil...

Generating classes using XSD without base class in each one

Not sure what the appropriate tags are here... A while back I created a batch script which, when run will convert all .xsd files found in C:\api\ into C# classes using the xsd.exe file found in the Microsoft Windows SDK (using v6.1 here). @ECHO OFF CLS ECHO *** ECHO Runs xsd.exe on all *.xsd files sorted by filename in the current fold...

Programming languages that compile to native code and have the batteries included

What are the programming languages that compile to native code and which have provided a comprehensive library with them? Libraries that includes functionality such as Networking, File IO, RegEx, Database, Graphics, Multimedia, Win32 API bindings, File compression, etc. ...

add assembly reference dialog

Is there a way to use visual studio's "add assembly reference dialog" (or something similar) in my own application? I need it for dynamic code generation and compilation. This is not simply an OpenFileDialog, since it additionally looks into the GAC and so on, so it will be very complicated to do it on my own, I think. If this is not p...

C/C++ Macro expansion vs. Code generation

Both Macro expansion & Code generation have pros & cons. What's your favorite approach and why? When should we choose one over the other? Please kindly advise. Thank you! Macro expansion can be very handy & helpful: http://dtemplatelib.sourceforge.net/table.htm vs While Code generation gives you plenty of nice code: http://code.google...

Any tools or techniques to enrich NetBeans code generation (web services)?

Hello. I'm working on a project that involves the creation of numerous web services. Top-down/contract-first and model-driven design strategies are utilized (WSDL -> codegen). NetBeans (6.7) + JAX-WS + GlassFish comprise the chosen tooling stack. The web services will be EJBs deployed as Composite Applications in the Glassfish JBI cont...

Is C++ code generation in ANTLR 3.2 ready?

Hi, I was trying hard to make ANTLR 3.2 generate parser/lexer in C++. It was fruitless. Things went well with Java & C though. I was using this tutorial to get started: http://www.ibm.com/developerworks/aix/library/au-c%5Fplusplus%5Fantlr/index.html When I checked the *.stg files, I found that: CPP has only ./tool/src/main/resources/...

Finding a hard time with Hibernate Code Generator Tool.. pls help

Hi All, I am trying to develop a wicket based web application using hibernate at the model layer with postgres DB. I created all my tables manually and i am trying to reverse engineer the code from the tables using hibernate code generator tool downloaded from www.hibernate.org. I have created the hibernate.cfg.xml and hibernate.reven...

Automatic Application Generator

Is it possible to write a automatic application generator that can output hundreds of applications/day? An application is just a series of binary values. If a super computer is put to generate millions of combinations/day and output the generated binaries with varying sizes. These binaries will then be "run" to see if they are actually r...

sql 2 xaml generator

Is there a more serious/commercial tool (than this) for generating a simple wpf forms from ms sql table metadata? ...

DataTable in T4 template

I'm creating a t4 template that will generate an enum from a number of values in our database. The weird thing is that as soon as I try to create a DataTable in the template code i get the ErrorGeneratingOutput message: <#@ template language="C#v3.5" debug="True" #> <#@ output extension="CS" #> <#@ assembly name="System.Data" #> <#@ as...

Has anyone tried using ASP.NET MVC's WebForms view engine to do code generaiton?

Has anyone tried using ASP.NET MVC's WebForms view engine to do code generaiton? I know it's a vague question, but I was thinking it would be nifty if I could do something like this from the command line: asp-net-mvc-codegen.exe entity?tablename=customer >> Customer.cs Which would in turn start up Cassini, GET the URL in question and...

Customizing Granite DS Actionscript code generation from Java classes

I'm using GraniteDS Actionscript code generation templates that let's me take a Java object and convert it to an Actionscript class. It's mainly used for BlazeDS Java to Flash communication but I'm adapting it to work with JSON webservices using XStream/JETTISON JSON. Is it possible to use the Granite DS Groovy templates to inspect an...

Language neutral custom tool

I'm working on a DSL tool, and for this tool, there exists a custom code generation tool that creates output files. Currently, this tool is registered with C# using a RegistrationAttribute on the DslPackage with the following code: class FileGenerationRegistrationAttribute : RegistrationAttribute { private const string CSharpGenerat...

Example of code generator you made from scratch?

What are some examples of code generators you have used? I think it's a cool idea, but I have trouble thinking of things they can do besides make a class based on an object's attributes/database schema (as described in The Pragmatic Programmer). What language did you write them in and what language did they output? Edit: Thanks for th...