Replies: 2 comments 8 replies
-
Hi, there are several different approaches for implementing code generation from a source model. I'd try to keep this orthogonal to GLSP; meaning that when your GLSP server changes the source model upon any operation, this change will trigger another component, which then generates code from the changed source model. This way, the GLSP is not really coupled to the code generation, which usually is also used in other use cases where no GLSP editor is running. How to best implement the code generator really depends on the type of your source model. Is it already an EMF model? Is it Xtext-based? Is it a simple JSON model? With Xtext there is very nice support for developing code generators from grammars and abstract syntax trees. You could also have a look at langium.org as a Typescript-based alternative. I'm aware of a proprietary and quite feature-rich implementation of IEC 61131-3 languages (ST, FBD, LD, etc.) which are using Xtext and GLSP:
Maybe there is an opportunity for you to contact them and collaborate? (see https://neuron-automation.eu) Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
at moment,i did not find any information whether glsp can integrate with xtext or langium,i just found sprotty-xtext or sprotty-langium,is it achieved by now?if so,how should i integrate glsp with xtext or langium |
Beta Was this translation helpful? Give feedback.
-
there is a requirement when user performs a change in the diagram(my requirement is industrial Programming Language LD(Ladder Diagram)) like drag a position of Gnode(or add a Gnode), the client sends a notification to the server. The server then applies the operation back to the source model ,The client will then update the rendered diagram based on the new graphical model it received,it seems easy to achieve by glap。
but there is higher requirement that also need to transform industrial Programming Language LD(Ladder Diagram) to other specific lauguage like C++ or PLC ST (Structured Text)language,is glap possible to achieve it?or should i intergate with glsp-xtext to achieve it?
Beta Was this translation helpful? Give feedback.
All reactions