Loading plugins/org.etsi.mts.tdl.rt.ui/src/org/etsi/mts/tdl/tools/rt/renderers/TTCN3Renderer.java +24 −10 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import org.etsi.mts.tdl.ComponentType; import org.etsi.mts.tdl.CompoundBehaviour; import org.etsi.mts.tdl.ConditionalBehaviour; import org.etsi.mts.tdl.DataElementUse; import org.etsi.mts.tdl.DataType; import org.etsi.mts.tdl.DataUse; import org.etsi.mts.tdl.Element; import org.etsi.mts.tdl.EnumDataType; Loading Loading @@ -274,7 +275,6 @@ public class TTCN3Renderer { String render(DataElementUse e, String indent) { String output = ""; if (e.getDataElement()!=null) { //TODO: arguments, reduction, other.. //TODO: anonymous types //TODO: with or without parameters, {} vs () Loading @@ -284,7 +284,11 @@ public class TTCN3Renderer { String assignedArguments =e.getArgument().stream() .map(m -> ttcnName(m.getParameter())+" := "+render(m.getParameter(), m.getDataUse(), "")) .collect(Collectors.joining(", ")); String items =e.getItem().stream() .map(m -> render(m, "")) .collect(Collectors.joining(", ")); if (e.getDataElement()!=null) { NamedElement dataElement = e.getDataElement(); output+=switch (dataElement) { case StructuredDataType d -> output+="{"+assignedArguments+"}"; Loading @@ -292,8 +296,18 @@ public class TTCN3Renderer { case Function d -> output+=ttcnName(e.getDataElement())+"("+arguments+")"; case Parameter d -> output+=ttcnName(e.getDataElement()); case SimpleDataInstance d -> output+=ttcnName(e.getDataElement()); case CollectionDataType d -> output+="{"+items+"}"; default -> "NOT_SUPPORTED_YET"; }; } else { DataType dataType = e.resolveDataType(); output+=switch (dataType) { case StructuredDataType d -> output+="{"+assignedArguments+"}"; case CollectionDataType d -> output+="{"+items+"}"; //TODO: collections default -> "NOT_SUPPORTED_YET"; }; } output+=renderReduction(e, indent); return output; Loading Loading
plugins/org.etsi.mts.tdl.rt.ui/src/org/etsi/mts/tdl/tools/rt/renderers/TTCN3Renderer.java +24 −10 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import org.etsi.mts.tdl.ComponentType; import org.etsi.mts.tdl.CompoundBehaviour; import org.etsi.mts.tdl.ConditionalBehaviour; import org.etsi.mts.tdl.DataElementUse; import org.etsi.mts.tdl.DataType; import org.etsi.mts.tdl.DataUse; import org.etsi.mts.tdl.Element; import org.etsi.mts.tdl.EnumDataType; Loading Loading @@ -274,7 +275,6 @@ public class TTCN3Renderer { String render(DataElementUse e, String indent) { String output = ""; if (e.getDataElement()!=null) { //TODO: arguments, reduction, other.. //TODO: anonymous types //TODO: with or without parameters, {} vs () Loading @@ -284,7 +284,11 @@ public class TTCN3Renderer { String assignedArguments =e.getArgument().stream() .map(m -> ttcnName(m.getParameter())+" := "+render(m.getParameter(), m.getDataUse(), "")) .collect(Collectors.joining(", ")); String items =e.getItem().stream() .map(m -> render(m, "")) .collect(Collectors.joining(", ")); if (e.getDataElement()!=null) { NamedElement dataElement = e.getDataElement(); output+=switch (dataElement) { case StructuredDataType d -> output+="{"+assignedArguments+"}"; Loading @@ -292,8 +296,18 @@ public class TTCN3Renderer { case Function d -> output+=ttcnName(e.getDataElement())+"("+arguments+")"; case Parameter d -> output+=ttcnName(e.getDataElement()); case SimpleDataInstance d -> output+=ttcnName(e.getDataElement()); case CollectionDataType d -> output+="{"+items+"}"; default -> "NOT_SUPPORTED_YET"; }; } else { DataType dataType = e.resolveDataType(); output+=switch (dataType) { case StructuredDataType d -> output+="{"+assignedArguments+"}"; case CollectionDataType d -> output+="{"+items+"}"; //TODO: collections default -> "NOT_SUPPORTED_YET"; }; } output+=renderReduction(e, indent); return output; Loading