ConsynMM.mvc 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. include "primitives.alh"
  2. SimpleAttribute String {
  3. constraint = $
  4. String function constraint(value : Element):
  5. if (is_physical_string(value)):
  6. return "OK"!
  7. else:
  8. return "String has a non-string value"!
  9. $
  10. }
  11. SimpleAttribute Integer {
  12. constraint = $
  13. String function constraint(value : Element):
  14. if (is_physical_int(value)):
  15. return "OK"!
  16. else:
  17. return "Integer has a non-integer value"!
  18. $
  19. }
  20. SimpleAttribute Boolean {
  21. constraint = $
  22. String function constraint(value : Element):
  23. if (is_physical_boolean(value)):
  24. return "OK"!
  25. else:
  26. return "Boolean has a non-boolean value"!
  27. $
  28. }
  29. Class Icon {
  30. name = "Icon"
  31. typeID : String
  32. is_primitive : Boolean
  33. }
  34. Class Image {
  35. name = "Image"
  36. data : String
  37. }
  38. Class Primitive {
  39. name = "Primitive"
  40. }
  41. Class Rectangle : Primitive {
  42. name = "Rectangle"
  43. x : Integer
  44. y : Integer
  45. width : Integer
  46. height : Integer
  47. }
  48. Class Ellipse : Primitive {
  49. name = "Ellipse"
  50. x : Integer
  51. y : Integer
  52. width : Integer
  53. height : Integer
  54. }
  55. Class Line : Primitive {
  56. name = "Line"
  57. start_x : Integer
  58. start_y : Integer
  59. end_x : Integer
  60. end_y : Integer
  61. }