Work Smarter Not Harder - Partial Code Generation Framework
May 21, 2019 by J. Tagoukeng
Thanks to the Partial Code Generator (PCG) framework, users can now not only continue to use their generators written in CINCO in Pyro without further modifications, but also save a lot of time during the model-to-text transformation (code generation) in Pyro. Therefore, the user can define a list of model elements and a list of changes on which the generation of files should depend. The list of model elements can include all types of model elements and represents the model elements on which changes have to be detected in order to trigger a new generation. Concerning the change list, it contains the types of changes that are to be detected or not, and can be passed as an white list or as black list if necessary. The white list should determine the changes to be detected, while the list should contain the changes to be ignored. A distinction is made between the following change types:
- SIZE: checks whether a model element has been added or deleted in a Container/GraphModel element type.
- POSITION: checks whether a model element (Node and Container types only) has been moved.
- ATTRIBUTE: checks whether an attribute of a model element has been edited.
- RESIZE: checks whether a model element (Node and Container types only) has been resized.
- CONNECTION: checks whether a model element (Edge type only) has been reconnect or bent.
During the generation process, the passed changes are checked for the passed model elements and, depending on this, the PCG decides whether or not the new generation should take place.
Example of Input :
- ([listOfModelElements],[whiteList]) or
- ([#1],[SIZE]) : checks whether a model element was added or deleted in the graphmodel.
- ([#1,#2],[SIZE]) : checks whether a model element was added or deleted in the graphmodel and in the container.
- ([#3,#4,#5],[SIZE]) : effectless. Because nodes cannot contain an element
- ([#3,#4,#5],[POSITION]) : checks wheter a node was moved.
- ([#3,#4,#5],,[POSITION]) : checks all other changes on nodes except their position.