For complex projects, it might be good to have a dedicated IDE for your Domain Specific Language used in code generation. For these cases the Eclipse Sirius ecosystem offers great support for creating custom IDEs to generate models to then use for code generation.
Creating Ecore Meta Model
https://wiki.eclipse.org/Sirius/Tutorials/DomainModelTutorial
Creating Model GUI
https://wiki.eclipse.org/Sirius/Tutorials
Generating Code From Model Instances:
https://wiki.eclipse.org/Acceleo
https://wiki.eclipse.org/Acceleo/Acceleo_Operations_Reference
For simple projects (smaller models) using Go itself might be an option for code generation.
I think many of the concepts I have learned from using the Eclipse Modeling tools will transfer over into this alternate path in Go.
Code generation using the Go ecosystem.
https://blog.carlmjohnson.net/ post/2016-11-27-how-to-use-go- generate/
Possibly express the model in YAML, read into Go structs as datasource for the templates:
https://github.com/go-yaml/yaml
https://blog.gopheracademy.com/advent-2016/go-syntax-for-dsls/
Another option: Text based DSL using XText.
http://www.eclipse.org/Xtext/
XText - while not being a graphical editor, does have some great features that might streamline the code generation process. You can create XText grammars using EBNF notation and then generate editors for these grammars.
Possibly express the model in YAML, read into Go structs as datasource for the templates:
https://github.com/go-yaml/yaml
https://blog.gopheracademy.com/advent-2016/go-syntax-for-dsls/
Another option: Text based DSL using XText.
http://www.eclipse.org/Xtext/
XText - while not being a graphical editor, does have some great features that might streamline the code generation process. You can create XText grammars using EBNF notation and then generate editors for these grammars.
No comments:
Post a Comment