def dump_parsers(json_dict, hlir, keep_pragmas=False):
    parsers = []
    parser_id = 0

    for name, p4_parse_state in hlir.p4_parse_states.items():
        new_name = None
        if name == "start":
            new_name = "parser"
        elif "packet_entry" in p4_parse_state._pragmas:
            new_name = name
        if new_name:
            parsers.append(dump_one_parser(
                new_name, parser_id, p4_parse_state, keep_pragmas=keep_pragmas))
            parser_id += 1

    json_dict["parsers"] = parsers