Topics related to the generation of code as the output of an application, instead of directly writing code by a programmer.
Questions tagged [code-generation]
3642 questions
2
votes
1 answer
Writing a compiler in C#, generating C vs IL?
I have been wanting to create my own programming language and I am looking to start writing a basic compiler. I am doing this purely for learning purposes.
I will be writing the compiler in C#.
I have been trying to decide whether or not to…

user3574076
- 711
- 1
- 6
- 23
2
votes
4 answers
Possible to modify the C# that Linq To SQL generates?
It would be really handy to be able to somehow say that certain properties in the generated entity classes should, for example, be decorated by (say) validation attributes (as well as Linq To SQL column attributes).
Is it a T4 template someplace? …

Peter Mounce
- 4,105
- 3
- 34
- 65
2
votes
1 answer
Generate IL to decrease counter in for loop
I am hacking around with the Good For Nothing (GFN) compiler, trying to make it do a few different things. I am using the code from here: https://github.com/johandanforth/good-for-nothing-compiler
Regular GFN for loop:
var x = 0;
for x = 0 to 3 do
…

user3574076
- 711
- 1
- 6
- 23
2
votes
1 answer
Where does @uml.property tag in javadoc come from?
I've stumbled across a piece of code written by someone before me who has left the company; I am the heir to his code.
What are these tags? I found them only in one specific Class file and they seem to be holding either little or lots of value. I…

insidesin
- 735
- 2
- 8
- 26
2
votes
0 answers
MATLAB to C codegen build error - input properties specification mismatch
I am trying to build a C/C++ static library from MATLAB code, but receive the following error:
"Function 'application' input properties specification mismatch:
expected 0 but found 2."
Here is the function that I am trying to convert:
function […

adub108
- 21
- 2
2
votes
1 answer
Add generated Python file as part of build
I am generating some Python files in my setup.py as part of the build process. These files should be part of the installation. I have successfully added my code generator as a pre-build step (by implementing my own Command and overriding the default…

Krumelur
- 31,081
- 7
- 77
- 119
2
votes
2 answers
How to load an arbitrary java .class file from the filesystem and reflect on it?
I want to make a command-line utility that does some operations based on reflection of external class files. I would pass in a path to .class files or source files(possibly wildcards). At some point during the execution, I need to get Class…

gtrak
- 5,598
- 4
- 32
- 41
2
votes
2 answers
What automatic code generation tools are available for Castle ActiveRecord classes?
If I have an existing database, I want to be able to automatically code generate the corresponding Castle ActiveRecord C# classes based on the db schema. My primary intent is to avoid manually creating each class. What are my options for code gen…

Ray
- 187,153
- 97
- 222
- 204
2
votes
3 answers
hibernate auto-discovery and generation of of database mappings to POJOs
Are there any tools that auto-generate the hibernate POJOs by gathering information from the database?
I made a perl script to do this after the schema got changed for the third or fourth time in a project i'm working with and just wondered if there…

dsm
- 10,263
- 1
- 38
- 72
2
votes
1 answer
Using Simulink Coder - atomic change of multidimensional parameters (matrix, vector)
I am using Simulink and Simulink Coder to generate a dll of arbitrary Models. My C Application uses the mathworks CAPI.
It runs arbitrary models (hard real time below 1 ms) and is able to modify any parameters of the model (by using the tunable…

ToBe
- 921
- 1
- 9
- 23
2
votes
1 answer
Way to generate a code that creates a constructor based on the current values of an object?
What I want to achieve is after loading my object from the database, to generate a code that will give me a block which initializes my object based on its current values so that I can use this code-block in my unit tests again and again without…

pencilCake
- 51,323
- 85
- 226
- 363
2
votes
1 answer
Create table programatically from entity annotation under JPA
Suppose the JPA provider is hibernate. Suppose it is not container managed, but application managed.
Given an entity class and correct annotation, is it possible to create table programatically, at runtime, and only for that class? By saying…

Kan Li
- 8,557
- 8
- 53
- 93
2
votes
1 answer
Does unregisterised mode requirement prevent Haskell's basic FFI examples in normal cases?
From the Haskell Wiki page about calling Haskell function from C, there is a nice short example that I am trying to reproduce, which boils down to compiling some Haskell code that uses the C FFI with command line options such as:
ghc -c -O…

ely
- 74,674
- 34
- 147
- 228
2
votes
5 answers
Admin auto generation
I create custom CMS sites and then go ahead for the backend/admin side. Is there any tool out there to automatically create admin side of my sites, for example, based on table relationships or whatever customization we may put in place.
PHPMaker…

Sarfraz
- 377,238
- 77
- 533
- 578
2
votes
3 answers
Generating unmanaged C++ via CodeDom
I'm looking to programmatically generate unmanaged C++ code via CodeDom. It seems that the default implementation of CppCodeProvider is only capable of generating managed C++/CLI.
Any alternatives out there?
Thanks!

Igal Tabachnik
- 31,174
- 15
- 92
- 157