> For the complete documentation index, see [llms.txt](https://energytransition.gitbook.io/esdl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://energytransition.gitbook.io/esdl/setting-up-eclipse-modelling-tools/contributing-to-the-esdl-language/generating-model-edit-and-editor-code.md).

# Generating model, edit and editor code

Since Ecore-based models such as the ESDL model contain semantics, source code can be generated from this model. EMF allows you to create three different types of source code:

* ESDL Model code - creates Java-classes out of the model, including the ECore semantics (they inherit from the`EObject-`class)
* ESDL Edit code - creates editor-independent code to manipulate and edit the ESDL model instances.
* ESDL Editor code - creates the Tree-based editor described [here](/esdl/how-to-use-esdl/using-esdl-to-model-an-energy-system/esdl-tree-editor.md) to edit ESDL model instances.

## Using the `.genmodel`

Code generation is specified in the `esdl.genmodel` file. In Eclipse you can open this file in its own editor. In the properties there are a lot of options you can configure to change the code generation behaviour.&#x20;

When right-clicking on the esdl-package you can select Generate... to generate one or more of the above mentioned artefacts, or press Ctrl+Shift+G to pop-up the Generator dialog.

![](/files/-LM2CIDf7Qdr_RBXFM3Z)

The current `esdl.genmodel` is configured to produce an XML Schema too, that can be used by other non-Java-based software. The next chapters shows how to integrate with e.g. Python.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://energytransition.gitbook.io/esdl/setting-up-eclipse-modelling-tools/contributing-to-the-esdl-language/generating-model-edit-and-editor-code.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
