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]
3366 questions
2
votes
2 answers
Passing JavaScript variable names and values from server script (ASP.NET)
What are some good ways to deal with this messy and unnecessary and not-really-dynamic generation of JavaScript:
var <%# JavascriptId %> = new BusinessChart(
'<%# JavascriptId %>',<%# CurrentUserId %>,'<%# ChartId %>'
,'<%#…
![](../../users/profiles/111934.webp)
Jeff Meatball Yang
- 34,069
- 26
- 85
- 118
2
votes
2 answers
CodeModel: manually insert import statement
How do I manually insert an import statement using CodeModel?
I'd like to use Arrays.toString(...) in a direct statement.
Context: I'm generating a toString() method in the generated code just like Eclipse does. The Arrays class is used to avoid…
![](../../users/profiles/447369.webp)
AndrewBourgeois
- 2,475
- 7
- 37
- 58
2
votes
1 answer
How to prove code correctness lemmas with the "undefined" constant
Given I have a very simple definition for code generation. It is only defined for certain cases and throws a runtime exception otherwise.
definition "blubb a = (if P a then True else undefined)"
Now I want to show blubb correct. The case in which…
![](../../users/profiles/2143551.webp)
corny
- 7,520
- 3
- 11
- 19
2
votes
1 answer
Efficient GC write barrier in generated C
I'm designing a system that up-front compiles CIL bytecode. In order to keep it relatively simple and also make it very portable, the system will emit C source code (however with all higher-level constructs like OOP factored out) instead of machine…
![](../../users/profiles/2019892.webp)
Kevin
- 1,079
- 6
- 17
2
votes
1 answer
Dynamically creating classes
I have been using active record for quite a while, and I wanted a little change of scenery, some developer friends suggested looking into ORM, all of the ORM projects I have looked at require a separate class extending the ORM class.
My question is:…
![](../../users/profiles/2132800.webp)
Jordan Doyle
- 2,724
- 3
- 19
- 36
2
votes
2 answers
TDD - Using properties to auto-generate code
I am practicing TDD using MsTest together with RhinoMocks, and I am trying to be as lazy as humanly possible, i.e. make use of VS2012 auto-generation wherever I can. But it doesn't always feel right to create an entire test method with the…
![](../../users/profiles/1904753.webp)
Riegardt Steyn
- 4,260
- 2
- 30
- 47
2
votes
1 answer
Testing - Generate xml files that do not conform a schema
for testing purposes, I'd like to generate xml samples that do not conform to an existing schema.
I want this files to be used for unit testing.
I think they would permit :
Detection of constructions a schema permits, though the writer didn't…
![](../../users/profiles/2067338.webp)
Antoine Marques
- 1,339
- 1
- 8
- 14
2
votes
3 answers
Compile/Execute XAML during program runtime
I would like to create an WPF Application which retrieves XAML Code from a Database and displays the retrieved code.
Lets say the database return the following code:
![](../../users/profiles/1842923.webp)
Joel
- 4,534
- 6
- 41
- 69
2
votes
1 answer
No enum in generated code using JAXB
My enum class
@XmlType
@XmlEnum(Integer.class)
public enum Error {
@XmlEnumValue("1")
ENUM_VALUE_1(1, "some string 1", "some string 1"),
@XmlEnumValue("2")
ENUM_VALUE_2(2, "some string 2", "some string 2");
private Error(int…
![](../../users/profiles/2026729.webp)
White Roses
- 279
- 1
- 5
- 16
2
votes
2 answers
How do I generate functions from the struct definitions?
I'm writing a library for deserializing data. I've got struct definitions like:
#ifndef SEARCHRESULTS_H
#define SEARCHRESULTS_H
typedef struct {
char *url;
} SearchResult;
typedef struct {
int count;
SearchResult *searchResults;
}…
![](../../users/profiles/577167.webp)
Joulukuusi
- 2,440
- 6
- 31
- 47
2
votes
8 answers
Are there any free tools to help with automatic code generation?
A few semesters back I had a class where we wrote a very rudimentary scheme parser and eventually an interpreter. After the class, I converted my parser into a C++ parser that did a reasonably good job of parsing C++ as long as I didn't do anything…
![](../../users/profiles/63791.webp)
Alex
- 13,729
- 13
- 55
- 88
2
votes
6 answers
Simple ADO.NET C# Stored Procedure Generator
I am using Visual Studio 2005, Sql Server 2005, C#, ADO.NET. We have a very large database and routinely adding new stored procedures. I am tired of writing the C# wrapper code for these stored procedures, seems like there should be some simple…
![](../../users/profiles/175938.webp)
Ron
- 878
- 2
- 13
- 26
2
votes
1 answer
A program that generates Java project from UML
Do you know any program that generates the whole Java project from UML for you with the classes, attributes, packages, function you have defined?
The program should be free.
Thanks in advance.
![](../../users/profiles/1979703.webp)
Niklas
- 18,855
- 28
- 114
- 153
2
votes
4 answers
How can I debug clojure code which was created at runtime?
Suppose I have an application written in clojure which generates code while it is running. How can I debug that code - for which I do not have the source code?
Edit: I'm asking this question, because I was chatting about clojure with my colleague…
![](../../users/profiles/485337.webp)
Adam Arold
- 26,256
- 18
- 92
- 176
2
votes
0 answers
Which code generator is used by eclipse for WSDL client?
I always generated by SOAP client by using the right click menu in eclipse on the WSDL file. Today I am facing an issue where I think I might be able to fix it by parameterizing the generation a bit.
This is the UI I am talking about:
Which…
![](../../users/profiles/508760.webp)
W. Goeman
- 1,564
- 1
- 14
- 28