Example #1
0
    def parse(cls, attributeNode: Iir) -> "Attribute":
        name = GetNameOfNode(attributeNode)
        subtypeMark = nodes.Get_Type_Mark(attributeNode)
        subtypeName = GetNameOfNode(subtypeMark)

        subtype = SimpleSubtypeSymbol(subtypeMark, subtypeName)
        return cls(attributeNode, name, subtype)
Example #2
0
    def parse(cls, node: Iir) -> "QualifiedExpression":
        from pyGHDL.dom._Translate import GetExpressionFromNode, GetNameOfNode

        typeMarkName = GetNameOfNode(nodes.Get_Type_Mark(node))
        subtype = SimpleSubtypeSymbol(node, typeMarkName)
        operand = GetExpressionFromNode(nodes.Get_Expression(node))
        return cls(node, subtype, operand)
Example #3
0
File: Type.py Project: umarcor/ghdl
    def parse(cls, typeName: str, typeDefinitionNode: Iir) -> "FileType":
        from pyGHDL.dom._Utils import GetNameOfNode

        designatedSubtypeMark = nodes.Get_File_Type_Mark(typeDefinitionNode)
        designatedSubtypeName = GetNameOfNode(designatedSubtypeMark)
        designatedSubtype = SimpleSubtypeSymbol(typeDefinitionNode,
                                                designatedSubtypeName)

        return cls(typeDefinitionNode, typeName, designatedSubtype)
Example #4
0
    def parse(cls, functionNode: Iir) -> "Function":
        from pyGHDL.dom._Translate import (
            GetGenericsFromChainedNodes,
            GetParameterFromChainedNodes,
        )

        functionName = GetNameOfNode(functionNode)

        generics = GetGenericsFromChainedNodes(nodes.Get_Generic_Chain(functionNode))
        parameters = GetParameterFromChainedNodes(nodes.Get_Interface_Declaration_Chain(functionNode))

        returnType = nodes.Get_Return_Type_Mark(functionNode)
        returnTypeName = GetNameOfNode(returnType)
        returnTypeSymbol = SimpleSubtypeSymbol(returnType, returnTypeName)

        return cls(functionNode, functionName, returnTypeSymbol, generics, parameters)
Example #5
0
def GetSimpleTypeFromNode(subtypeIndicationNode: Iir) -> SimpleSubtypeSymbol:
    subtypeName = GetNameFromNode(subtypeIndicationNode)
    return SimpleSubtypeSymbol(subtypeIndicationNode, subtypeName)