code-generation

Representing classes and interfaces in a language neutral way

I need to define simple classes and interfaces (Ex. IClassInterface) in a language neutral way and then use a variety of code generation tools to generate the code files in a variety of languages such as C#, Java, etc... Does anyone know of a standard; ratified or otherwise; that I can use for the neutral representation. I know UML is of...

How to generate helper classes and stub code with wsdl2php for a PHP web service?

Hi, I have a WSDL generated by WCF and now this WSDL should be used to create a PHP web service. My WSDL contains mappings to custom .NET classes (complexType) and I would need a PHP WSDL tool which can generate the equivalent PHP classes as well as the stub code (server-side generation). I read that the wsdl2php would be the right too...

What's the use of metaprogramming?

I've read: Wikipedia Code Generation vs. Metaprogramming The art of Metaprogramming Metaprogramming at c2.com and I confess some confusion at the purpose behind metaprogramming/code generation. Does anyone have a concrete example of where they use metaprogramming/code generation? Even better would be an accompanying explanation of w...

Looking to Build a QR Genrator

Can anyone tell me how to go about building a QR generator? I would like to create custom QR codes for address book entry on mobile phones. Thank you for your help. ...

Python ORM that automatically creates classes from DB schema

Hi, is there a python ORM (object relational mapper) that has a tool for automatically creating python classes (as code so I can expand them) from a given database schema? I'm frequently faced with small tasks involving different databases (like importing/exporting from various sources etc.) and I thought python together with the above...

how to generate constuctors in eclipse

I have a class A and B.M extends A. Now I want a create a constructor of B using code generation option of eclipse which accepts parameters and set values of all fields of B (I mean it should also set fields inherited from A). Is there any shortcut to generate such code in eclipse? ...

Disable databinding in MXML

When the Flex SDK converts MXML to actionscript it generates a lot of databinding code. Sometimes, however, I don't want to bind a variable, for example if I know the variable will not change. I can't seem to find a work around in Flex to disable the autogenerated databinding. Also, I was hoping this might also help with some of the...

T4 tool for XCode

Hello folk, Does anything like the T4 text template generation tool of visual studio exist for XCode? Thanks for help, Enyra ...

Modifying generated code

I'm wrapping a C++ library in PHP using SWIG and there have been some occasions where I want to modify the generated code (both generated C++ and PHP): Fix code-generation errors Add code that makes sense in PHP, but not in C++ (e.g. type checking) Add documentation tags (e.g. phpDoc) I'm currently automating these modifications with...

IVsSingleFileGenerator equivalent for multiple files?

I'm writing a custom tool for Visual Studio and am currently using the IVsSingleFileGenerator interface. This works for the most part, but now I'd like to generate more than one file output. Does anyone know how do go about doing this? I'm really hoping there is just a different interface to implement. ...

T4 Preprocessed Template Debugging Not Working - Visual Studio 2010 RTM

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 curren...

Auto-generate variable *name* to match parameter you're providing?

R# 4.5 (answers to 5 are welcome) VS2008 (answers to VS2010 are welcome) C# (FWIW) I'm using a constructor (the question applies for methods, too), and there's Intellisense: I don't yet have a value to specify for this first parameter, "firstName". Today, I type "firstName", then let the IDE create that variable for me (which I init...

How to break a for-each loop when value is set to prevent a double evaluation?

UPDATE: Improved the explanation so hopefully the problem is clear now :) Hi all! I've got a XML in which transitions of a FSM are declared (and events and states offcourse). Here's a simplified version of the XML which also causes the problem which is described below: <?xml version="1.0" encoding="UTF-8"?> <FSM name="MediaPlayer"> ...

Are there any data-binding solution that works in C++ and GWT and supports structures polymorphism?

I expect it should share a common description, like XmlSchema or IDL and should generate classes for target language. I found Thrift and it's really nice solution, but it doesn't support structures polymorphism. I would like to have collections of base class objects, where I could place instances of subclasses, serialize this and deseri...

Where would I start if I want to create a code generator for Visual Studio 2010?

I use the repository pattern for pretty much all of my projects. I have a .edmx/.dbml file that has my database tables referenced, and then for each table I create a 'Tablename'Repository.cs Each of these classes have the same methods with only the type of table being called being changed. public IQueryable<Area> FindAll() public IQuer...

How to turn off generators for RSpec 2 in Rails 3?

I installed the current RSpec 2 Beta under Rails 3 RC as mentioned on the GitHub page (and several blogs). Everything works fine, but I am not able to turn off specific generators like advised on some blogs. Here is what I do in ./config/application.rb: config.generators do |g| g.test_framework :rspec, :fixtures => false, :views => f...

A Java/Groovy API to generate Groovy source files

I'm looking for a Java or Groovy library to generate Groovy classes source files. I've CodeModel and this post but they are for Java. Basically, I'd like to generate a Groovy class programmatically knowing the class name, the class attributes and generate particular methods depending on the class attributes. I know Groovy templates, bu...

When using Doctrine::generateYamlFromDb(), can I specify a prefix to use?

When using Doctrine::generateYamlFromDb(), can I specify a prefix to use? For example, if the table name is "user", by default, the generated class name would be "User". Can I make sure the class name (and filename) is "PrefixUser"? ...

Generate serializable classes from entity framework classes?

Here's my problem: I am creating a Blackberry application that access's my data via a web service. The web service is using entity framework which was created for my web application. I use the SUN wireless toolkit stub generator to create the code and classes to access the web service from the Blackberry application. The stub generator...

Visual studio 2010 database project and code generation

Hi, I'm trying to use the database project in VS2010, but my setup is a bit different from standard and I can't find an easy way to get it to work. I have a "model" project which contains some xml model definitions of a simple information for an ETL process. As well as the schema for the supplied information, it contains other metadat...