Entitas-csharp: [EntitasLang:] Code generation future

Created on 11 Mar 2017  路  2Comments  路  Source: sschmid/Entitas-CSharp

Entitas-Lang currently consists of 2 parts

  1. The language and grammar
  2. Code Generation

This is very convenient for the developer, since all you have to do is save your file and you get all the generated code.
It is not as convenient for the maintainer, since changes to the code generator have to be implemented both in the existing C# code generator AND the Entitas-Lang code generator. Currently this also requires a new release of Entitas-Lang even if the grammar did not change.

In the long-term I don't think this is an ideal solution. I'd like to have a solution where changes to the code generator have to be implemented only once. I'd also like to keep the flexibility of the current C# code generator architecture which allows modification and extension for your own needs.

My suggestion:
Entitas-Lang could generate a text file (e.g. JSON) of the model instead of generating C# code. We could add a new EntitasLangDataProvider to the current C# code generator which will parse the text file and enable us to reuse all existing generators.

Any suggestions and ideas are welcome!

research rfc

Most helpful comment

JSON output is exactly what I spoke to @mzaks about, I wanted to use Entitas-Lang with your code generator because I liked certain things that Entitas-Lang generated like interfaces, abstract classes etc but didn't like the abstract class accepting a contexts class over the actual context e.g. GameContext (among other things I wanted to add which required Entitas-Lang not handling the generation). I want to control that.

All 2 comments

JSON output is exactly what I spoke to @mzaks about, I wanted to use Entitas-Lang with your code generator because I liked certain things that Entitas-Lang generated like interfaces, abstract classes etc but didn't like the abstract class accepting a contexts class over the actual context e.g. GameContext (among other things I wanted to add which required Entitas-Lang not handling the generation). I want to control that.

Based on recent advancements with the roslyn plugin for the code generator, I will close.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

moixxsyc picture moixxsyc  路  4Comments

FNGgames picture FNGgames  路  5Comments

sschmid picture sschmid  路  4Comments

KumoKairo picture KumoKairo  路  4Comments

yanjingzhaisun picture yanjingzhaisun  路  4Comments