<commit_before>parser grammar Cisco_bgp;

import Cisco_common;

options {
   tokenVocab = CiscoLexer;
}

activate_bgp_tail
:
   ACTIVATE NEWLINE
;

address_family_header
:
   ADDRESS_FAMILY
   (
      (
         IPV4 MDT?
      )
      | IPV6
      | VPNV4
      | VPNV6
   )
   (
      UNICAST
      | MULTICAST
   )?
   (
      VRF vrf_name = VARIABLE
   )? NEWLINE
;

address_family_footer
:
   (
      (
         EXIT_ADDRESS_FAMILY
         | EXIT
      ) NEWLINE
   )?
;

address_family_rb_stanza
:
   address_family_header
   (
      aggregate_address_rb_stanza
      | bgp_tail
      | neighbor_rb_stanza
      | no_neighbor_activate_rb_stanza
      | no_neighbor_shutdown_rb_stanza
      | null_disable_peer_as_check_stanza
      | null_no_neighbor_rb_stanza
      | peer_group_assignment_rb_stanza
      | peer_group_creation_rb_stanza
   )* address_family_footer
;

aggregate_address_rb_stanza
:
   AGGREGATE_ADDRESS
   (
      (
         network = IP_ADDRESS subnet = IP_ADDRESS
      )
      | prefix = IP_PREFIX
      | ipv6_prefix = IPV6_PREFIX
   )
   (
      as_set = AS_SET
      | summary_only = SUMMARY_ONLY
      (
         ATTRIBUTE_MAP mapname = variable
      )
   )* NEWLINE
;

allowas_in_bgp_tail
:
   ALLOWAS_IN
   (
      num = DEC
   )? NEWLINE
;

always_compare_med_rb_stanza
:
   BGP ALWAYS_COMPARE_MED NEWLINE
;

as_override_bgp_tail
:
   AS_OVERRIDE NEWLINE
;

auto_summary_bgp_tail
:
   NO? AUTO_SUMMARY NEWLINE
;
<commit_msg>fix int#0000031: aggregate_address_rb_stanza broken by recent update<commit_after>parser grammar Cisco_bgp;

import Cisco_common;

options {
   tokenVocab = CiscoLexer;
}

activate_bgp_tail
:
   ACTIVATE NEWLINE
;

address_family_header
:
   ADDRESS_FAMILY
   (
      (
         IPV4 MDT?
      )
      | IPV6
      | VPNV4
      | VPNV6
   )
   (
      UNICAST
      | MULTICAST
   )?
   (
      VRF vrf_name = VARIABLE
   )? NEWLINE
;

address_family_footer
:
   (
      (
         EXIT_ADDRESS_FAMILY
         | EXIT
      ) NEWLINE
   )?
;

address_family_rb_stanza
:
   address_family_header
   (
      aggregate_address_rb_stanza
      | bgp_tail
      | neighbor_rb_stanza
      | no_neighbor_activate_rb_stanza
      | no_neighbor_shutdown_rb_stanza
      | null_disable_peer_as_check_stanza
      | null_no_neighbor_rb_stanza
      | peer_group_assignment_rb_stanza
      | peer_group_creation_rb_stanza
   )* address_family_footer
;

aggregate_address_rb_stanza
:
   AGGREGATE_ADDRESS
   (
      (
         network = IP_ADDRESS subnet = IP_ADDRESS
      )
      | prefix = IP_PREFIX
      | ipv6_prefix = IPV6_PREFIX
   )
   (
      as_set = AS_SET
      | summary_only = SUMMARY_ONLY
      |
      (
         ATTRIBUTE_MAP mapname = variable
      )
   )* NEWLINE
;

allowas_in_bgp_tail
:
   ALLOWAS_IN
   (
      num = DEC
   )? NEWLINE
;

always_compare_med_rb_stanza
:
   BGP ALWAYS_COMPARE_MED NEWLINE
;

as_override_bgp_tail
:
   AS_OVERRIDE NEWLINE
;

auto_summary_bgp_tail
:
   NO? AUTO_SUMMARY NEWLINE
;

{'fraction_non_alphanumeric': 0.05732484076433121, 'fraction_numerical': 0.006369426751592357, 'mean_word_length': 2.3155555555555556, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5661783', 'n_tokens_mistral': 1204, 'n_tokens_neox': 1142, 'n_words': 154}