Concrete syntax no longer indentation-based (nightmare to parse). Add indented multi-line code terminals.

This commit is contained in:
Joeri Exelmans 2024-10-07 18:18:05 +02:00
parent 59de61d0a3
commit e875821e70
8 changed files with 119 additions and 73 deletions

View file

@ -15,12 +15,16 @@ def ramify(state: State, model: UUID, prefix = "RAM_") -> UUID:
string_type_id = state.read_dict(state.read_root(), "String")
string_type = UUID(state.read_value(string_type_id))
actioncode_type_id = state.read_dict(state.read_root(), "ActionCode")
actioncode_type = UUID(state.read_value(actioncode_type_id))
m_scd = scd.SCD(model, state)
ramified = state.create_node()
ramified_scd = scd.SCD(ramified, state)
string_modelref = ramified_scd.create_model_ref("String", string_type)
actioncode_modelref = ramified_scd.create_model_ref("ActionCode", actioncode_type)
classes = m_scd.get_classes()
for class_name, class_node in classes.items():
@ -44,7 +48,7 @@ def ramify(state: State, model: UUID, prefix = "RAM_") -> UUID:
# print(' creating attribute', attr_name, "with type String")
# Every attribute becomes 'string' type
# The string will be a Python expression
ramified_attr_link = ramified_scd._create_attribute_link(prefix+class_name, string_modelref, prefix+attr_name, optional=True)
ramified_attr_link = ramified_scd._create_attribute_link(prefix+class_name, actioncode_modelref, prefix+attr_name, optional=True)
# traceability link
bottom.create_edge(ramified_attr_link, attr_edge, RAMIFIES_LABEL)