@@ -687,16 +687,23 @@ newtype TContent =
687
687
class Content extends TContent {
688
688
/** Gets a textual representation of this element. */
689
689
string toString ( ) { result = "Content" }
690
+
691
+ /** Gets the Models-as-Data representation of this content (if any). */
692
+ string getMaDRepresentation ( ) { none ( ) }
690
693
}
691
694
692
695
/** An element of a list. */
693
696
class ListElementContent extends TListElementContent , Content {
694
697
override string toString ( ) { result = "List element" }
698
+
699
+ override string getMaDRepresentation ( ) { result = "ListElement" }
695
700
}
696
701
697
702
/** An element of a set. */
698
703
class SetElementContent extends TSetElementContent , Content {
699
704
override string toString ( ) { result = "Set element" }
705
+
706
+ override string getMaDRepresentation ( ) { result = "SetElement" }
700
707
}
701
708
702
709
/** An element of a tuple at a specific index. */
@@ -709,6 +716,8 @@ class TupleElementContent extends TTupleElementContent, Content {
709
716
int getIndex ( ) { result = index }
710
717
711
718
override string toString ( ) { result = "Tuple element at index " + index .toString ( ) }
719
+
720
+ override string getMaDRepresentation ( ) { result = "TupleElement[" + index + "]" }
712
721
}
713
722
714
723
/** An element of a dictionary under a specific key. */
@@ -721,11 +730,15 @@ class DictionaryElementContent extends TDictionaryElementContent, Content {
721
730
string getKey ( ) { result = key }
722
731
723
732
override string toString ( ) { result = "Dictionary element at key " + key }
733
+
734
+ override string getMaDRepresentation ( ) { result = "DictionaryElement[" + key + "]" }
724
735
}
725
736
726
737
/** An element of a dictionary under any key. */
727
738
class DictionaryElementAnyContent extends TDictionaryElementAnyContent , Content {
728
739
override string toString ( ) { result = "Any dictionary element" }
740
+
741
+ override string getMaDRepresentation ( ) { result = "DictionaryElementAny" }
729
742
}
730
743
731
744
/** An object attribute. */
@@ -738,6 +751,8 @@ class AttributeContent extends TAttributeContent, Content {
738
751
string getAttribute ( ) { result = attr }
739
752
740
753
override string toString ( ) { result = "Attribute " + attr }
754
+
755
+ override string getMaDRepresentation ( ) { result = "Attribute[" + attr + "]" }
741
756
}
742
757
743
758
/** A captured variable. */
@@ -750,6 +765,8 @@ class CapturedVariableContent extends Content, TCapturedVariableContent {
750
765
VariableCapture:: CapturedVariable getVariable ( ) { result = v }
751
766
752
767
override string toString ( ) { result = "captured " + v }
768
+
769
+ override string getMaDRepresentation ( ) { none ( ) }
753
770
}
754
771
755
772
/**
0 commit comments