background preloader

Code generation

Facebook Twitter

Creating Your Own Domain-Specific Language. Generating Code for DSLs. When you build a Domain Specific Language (DSL), how do you go about making it executable.

Generating Code for DSLs

This is an easy question to answer for an internal DSL, since they are embedded into real languages. An external DSL needs more work. Here I take a simple DSL example and show a few simple ways to generate code from it. I recently wrote an article describing language oriented programming and the recent evolution of a bunch of tools which I call language workbenches. In that article I used a simple Domain Specific Language to illustrate my points. So in this article I'll take the simple example from that article, and show some simple ways by which we could go about generating code. When thinking about the trade-offs in using DSLs, you don't really need to understand how generation works. I'll start with the custom language case. In order to get the custom case to work we need to transform it into the equivalent of the internal DSL case.

Single Pass Builder Two Pass Builder class BuilderParserXml... Database Refactoring. Code Generation for Dummies. Code Generation for Dummies Matthew FowlerNew Technology / enterprise, Introduction When I was a lad, code generation referred to the final phase of a compiler.

Code Generation for Dummies

Having digested your source code, the compiler would pump out the "code" for the target machine. At that time, "machine" meant a CPU instruction set - so this was machine operation code being generated. Meta Programming System — Language Oriented Programming environment and DSL creation tool. Jule - Code generator in Java. Cross platform code generation in java... supports sql server, mysql, jdbc, .... generation from templates in freemarker... by Luis Molina.

jule - Code generator in Java

ANTLR. DMS Software Reengineering Toolkit. The DMS Software Reengineering Toolkit is a set of tools for automating customized source program analysis, modification or translation or generation of software systems, containing arbitrary mixtures of languages ("domains").

DMS Software Reengineering Toolkit

The term "software" for DMS is very broad and covers any formal notation, including programming languages, markup languages, hardware description languages, design notations, data descriptions, and domain-specific languages. This toolkit is the first step towards the implementation of the Design Maintenance System®, an ambitious vision of a 21st Century software engineering environment that supports the incremental construction and maintenance of large application systems, driven by semantics and captured designs. See a comparison of DMS to other well-known types of compiler technologies. The Software Reengineering Toolkit can be used to implement a wide variety of program enhancing tools. DMS Capabilities Industrial Scale Available Languages Business Focus Platform. CodeSmith Tools.

Generator Templates CodeSmith Generator ships with a complete template set that helps you get up and running in no time flat.

CodeSmith Tools

These template sets include ActiveSnippet Templates, Database Templates, Example Templates, Framework Templates and various other templates. Why waste time with repetitive tasks? Use ActiveSnippets and focus on other parts of your application. ActiveSnippet Templates ActiveSnippet's allow you to quickly reduce the amount of time it takes to get your job done. Learn more by watching the ActiveSnippet Overview Video.

Database Templates Whether you are looking for an easier ways to create a business object, document your database, script your table data, execute or create stored procedures, generator is here to save you time and headaches. The Business Object template is a template that is a great template to use if your looking to quickly create an entity for your project. The DbDocumenter template will create a nicely formatted html document of your entire database. Apache MetaModel.