exInclude.tex 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. \begin{tomcode3}[label=code:exInclude,caption=Forme générale de la transformation \emph{Text2Picture} écrite en {\tomjava}.]
  2. ...
  3. public class TestText2Picture {
  4. ...
  5. %include{ text.TextEPackage.tom }
  6. %include{ picture.PictureEPackage.tom }
  7. ...
  8. %transformation Text2Picture(gp:GeoPicture):text.ecore -> picture.ecore {
  9. ...
  10. definition Letter2Shape traversal `TopDown(Letter2Shape(gp)) {
  11. AText() -> { ... }
  12. BText() -> { ... }
  13. }
  14. ...
  15. definition Symbol2Shape traversal `BottomUp(Symbol2Shape(gp)) {
  16. SemiColon() -> { ... }
  17. }
  18. ...
  19. }
  20. ...
  21. public static void main(String[] args) {
  22. ...
  23. `Text2Picture(gp).visit(input_model);
  24. `TopDown(Resolve(gp)).visit(gp);
  25. }
  26. ...
  27. }
  28. \end{tomcode3}
  29. % %transformation Text2Picture(gp:GeoPicture):text.ecore -> geopicture.ecore {
  30. % definition Letter2Shape traversal `TopDown(Letter2Shape(gp)) {
  31. % b@BText() -> { ... }
  32. % AText() -> { ... }
  33. % ...
  34. % }
  35. % ...
  36. % definition Symbol2Shape traversal `BottomUp(Symbol2Shape(gp)) {
  37. % sym@SemiColonText[left=l,right=r] -> { ... }
  38. % ...
  39. % }
  40. % ...
  41. % }
  42. % ...
  43. %}