import_metamodel.alc 1.5 KB

12345678910111213141516171819202122232425262728
  1. Element function import_metamodel():
  2. // TODO
  3. // For the moment, we make the assumption that it doesn't exist yet.
  4. // We create both the Simple Class Diagrams model, retype it, and then make the metamodel as an instance of this
  5. // In the future, this should already exist though...
  6. // Instatiate as bottom
  7. Element scd
  8. Element scd_model
  9. scd = create_node()
  10. scd_model = create_node()
  11. dict_add(scd, "model", scd_model)
  12. instantiate_bottom_node(scd, "Class")
  13. instantiate_bottom_value(scd, "__Type", Type)
  14. instantiate_bottom_value(scd, "__String", String)
  15. instantiate_bottom_edge(scd, "__Attribute_", dict_read(scd_model, "Class"), dict_read(scd_model, "__Type"))
  16. instantiate_bottom_edge(scd, "__AttributeAttrs", dict_read(scd_model, "__Attribute_"), dict_read(scd_model, "__Type"))
  17. instantiate_bottom_edge(scd, "__Attribute", dict_read(scd_model, "Class"), dict_read(scd_model, "__Type"))
  18. instantiate_bottom_edge(scd, "__Name", dict_read(scd_model, "__Attribute"), dict_read(scd_model, "__String"))
  19. instantiate_bottom_edge(scd, "Association", dict_read(scd_model, "Class"), dict_read(scd_model, "Class"))
  20. instantiate_bottom_edge(scd, "Inheritance", dict_read(scd_model, "Class"), dict_read(scd_model, "Class"))
  21. instantiate_bottom_edge(scd, "__inh_1", dict_read(scd_model, "Association"), dict_read(scd_model, "Class"))
  22. instantiate_bottom_edge(scd, "__inh_2", dict_read(scd_model, "__Attribute_"), dict_read(scd_model, "Class"))
  23. // Instantiated, now retype to make sure that everything is correct
  24. Element mapping
  25. mapping = create_node()