12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- \begin{tomcode3}[label=code:exInclude,caption=Forme générale de la transformation \emph{Text2Picture} écrite en {\tomjava}.]
- ...
- public class TestText2Picture {
- ...
- %include{ text.TextEPackage.tom }
- %include{ picture.PictureEPackage.tom }
- ...
- %transformation Text2Picture(gp:GeoPicture):text.ecore -> picture.ecore {
- ...
- definition Letter2Shape traversal `TopDown(Letter2Shape(gp)) {
- AText() -> { ... }
- BText() -> { ... }
- }
- ...
- definition Symbol2Shape traversal `BottomUp(Symbol2Shape(gp)) {
- SemiColon() -> { ... }
- }
- ...
- }
- ...
- public static void main(String[] args) {
- ...
- `Text2Picture(gp).visit(input_model);
- `TopDown(Resolve(gp)).visit(gp);
- }
- ...
- }
- \end{tomcode3}
- % %transformation Text2Picture(gp:GeoPicture):text.ecore -> geopicture.ecore {
- % definition Letter2Shape traversal `TopDown(Letter2Shape(gp)) {
- % b@BText() -> { ... }
- % AText() -> { ... }
- % ...
- % }
- % ...
- % definition Symbol2Shape traversal `BottomUp(Symbol2Shape(gp)) {
- % sym@SemiColonText[left=l,right=r] -> { ... }
- % ...
- % }
- % ...
- % }
- % ...
- %}
|