Exemple #1
0
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)
Exemple #2
0
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)
Exemple #3
0
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)