def leftest_location(n): while True: if n == nodes.Null_Iir: return files_map.No_Location k = nodes.Get_Kind(n) if k == nodes.Iir_Kind.Array_Subtype_Definition: n = nodes.Get_Subtype_Type_Mark(n) else: return nodes.Get_Location(n)
def GetScalarConstrainedSubtypeFromNode( subtypeIndicationNode: Iir, ) -> ConstrainedScalarSubtypeSymbol: typeMark = nodes.Get_Subtype_Type_Mark(subtypeIndicationNode) typeMarkName = GetNameOfNode(typeMark) simpleTypeMark = SimpleName(typeMark, typeMarkName) rangeConstraint = nodes.Get_Range_Constraint(subtypeIndicationNode) r = GetRangeFromNode(rangeConstraint) return ConstrainedScalarSubtypeSymbol(subtypeIndicationNode, simpleTypeMark, r)
def GetCompositeConstrainedSubtypeFromNode( subtypeIndicationNode: Iir, ) -> ConstrainedCompositeSubtypeSymbol: typeMark = nodes.Get_Subtype_Type_Mark(subtypeIndicationNode) typeMarkName = GetNameOfNode(typeMark) simpleTypeMark = SimpleName(typeMark, typeMarkName) constraints = GetArrayConstraintsFromSubtypeIndication( subtypeIndicationNode) return ConstrainedCompositeSubtypeSymbol(subtypeIndicationNode, simpleTypeMark, constraints)