def parse_instruction(string, location, tokens):
    mnemonic = tokens.get("mnemonic")
    operands = [op for op in tokens.get("operands", [])]

    instr = ArmInstruction(
        string,
        mnemonic["ins"],
        operands,
        arch_info.architecture_mode
    )

    if "cc" in mnemonic:
        instr.condition_code = cc_mapper[mnemonic["cc"]]

    if "uf" in mnemonic:
        instr.update_flags = True

    if "ldm_stm_addr_mode" in mnemonic:
        instr.ldm_stm_addr_mode = ldm_stm_am_mapper[mnemonic["ldm_stm_addr_mode"]]

    return instr

# Grammar Rules
# ============================================================================ #
Parse an ARM instruction.
dataset/ETHPy150Open programa-stic/barf-project/barf/barf/arch/arm/armparser.py/parse_instruction