def METHOD_NAME(die: DIE, expr_parser, elf_object: "ELF", lexical_block: Optional["LexicalBlock"] = None):
    # first the address
    if "DW_AT_location" in die.attributes and die.attributes["DW_AT_location"].form == "DW_FORM_exprloc":
        parsed_exprs = expr_parser.parse_expr(die.attributes["DW_AT_location"].value)
        if len(parsed_exprs) == 1 and parsed_exprs[0].op_name == "DW_OP_addr":
            addr = parsed_exprs[0].args[0]
            var = MemoryVariable(elf_object, addr)
        elif len(parsed_exprs) == 1 and parsed_exprs[0].op_name == "DW_OP_fbreg":
            addr = parsed_exprs[0].args[0]
            var = StackVariable(elf_object, addr)
        elif len(parsed_exprs) == 1 and parsed_exprs[0].op_name.startswith("DW_OP_reg"):
            addr = parsed_exprs[0].op - 0x50  # 0x50 == DW_OP_reg0
            var = RegisterVariable(elf_object, addr)
        else:
            var = Variable(elf_object)
    else:
        var = Variable(elf_object)
    if "DW_AT_name" in die.attributes:
        var.name = die.attributes["DW_AT_name"].value.decode("utf-8")
    if "DW_AT_type" in die.attributes:
        var._type_offset = die.attributes["DW_AT_type"].value + die.cu.cu_offset
    if "DW_AT_decl_line" in die.attributes:
        var.decl_line = die.attributes["DW_AT_decl_line"].value
    if "DW_AT_external" in die.attributes:
        var.external = True
    if "DW_AT_declaration" in die.attributes:
        var.declaration_only = True
    var.lexical_block = lexical_block
    return var