<commit_before>parser grammar FlatJuniper_interfaces;

import FlatJuniper_common;

options {
   tokenVocab = FlatJuniperLexer;
}

brt_interface_mode
:
   INTERFACE_MODE interface_mode
;

brt_vlan_id_list
:
   VLAN_ID_LIST DEC
;

direction
:
   INPUT
   | INPUT_LIST
   | OUTPUT
   | OUTPUT_LIST
;

famt_bridge
:
   BRIDGE famt_bridge_tail
;

famt_bridge_tail
:
// intentional blank

   | brt_interface_mode
   | brt_vlan_id_list
;

famt_ccc
:
   CCC s_null_filler
;

famt_inet
:
   INET famt_inet_tail
;

famt_inet_tail
:
// intentional blank

   | ifamt_address
   | ifamt_filter
   | ifamt_mtu
   | ifamt_no_redirects
   | ifamt_null
;

famt_inet6
:
   INET6 s_null_filler
;

famt_iso
:
   ISO s_null_filler
;

famt_mpls
:
   MPLS famt_mpls_tail
;

famt_mpls_tail
:
// intentional blank alternative

   | mfamt_filter
   | mfamt_maximum_labels
   | mfamt_mtu
;

filter
:
   FILTER filter_tail
;

filter_tail
:
// intentional blank

   | ft_direction
;

ft_direction
:
   direction name = variable
;

ifamat_master_only
:
   MASTER_ONLY
;

ifamat_preferred
:
   PREFERRED
;

ifamat_primary
:
   PRIMARY
;

ifamat_vrrp_group
:
   VRRP_GROUP name = variable ifamat_vrrp_group_tail
;

ifamat_vrrp_group_tail
:
   ivrrpt_accept_data
   | ivrrpt_preempt
   | ivrrpt_priority
   | ivrrpt_track
   | ivrrpt_virtual_address
;

ifamt_address
:
   ADDRESS IP_PREFIX ifamt_address_tail?
;

ifamt_address_tail
:
   ifamat_master_only
   | ifamat_preferred
   | ifamat_primary
   | ifamat_vrrp_group
;

ifamt_filter
:
   filter
;

ifamt_mtu
:
   it_mtu
;

ifamt_no_redirects
:
   NO_REDIRECTS
;

ifamt_null
:
   (
      SAMPLING
      | SERVICE
   ) s_null_filler
;

interface_mode
:
   TRUNK
;

it_apply_groups
:
   s_apply_groups
;

it_apply_groups_except
:
   s_apply_groups_except
;

it_common
:
   it_apply_groups
   | it_apply_groups_except
   | it_description
   | it_disable
   | it_enable
   | it_family
   | it_mtu
   | it_null
   | it_vlan_id
   | it_vlan_tagging
;

it_description
:
   s_description
;

it_disable
:
   DISABLE
;

it_enable
:
   ENABLE
;

it_family
:
   FAMILY it_family_tail
;

it_family_tail
:
   famt_bridge
   | famt_ccc
   | famt_inet
   | famt_inet6
   | famt_iso
   | famt_mpls
;

it_flexible_vlan_tagging
:
   FLEXIBLE_VLAN_TAGGING
;

it_mtu
:
   MTU size = DEC
;

it_null
:
   (
      AGGREGATED_ETHER_OPTIONS
      | BANDWIDTH
      | ENCAPSULATION
      | FRAMING
      | GIGETHER_OPTIONS
      | HOLD_TIME
      | INTERFACE_TRANSMIT_STATISTICS
      | MULTISERVICE_OPTIONS
      | NO_TRAPS
      | SONET_OPTIONS
      | TRACEOPTIONS
      | TRAPS
      | TUNNEL
   ) s_null_filler
;

it_unit
:
   UNIT
   (
      WILDCARD
      | num = DEC
   ) it_unit_tail
;

it_unit_tail
:
// intentional blank

   | it_common
;

it_vlan_id
:
   VLAN_ID id = DEC
;

it_vlan_tagging
:
   VLAN_TAGGING
;

ivrrpt_accept_data
:
   ACCEPT_DATA
;

ivrrpt_preempt
:
   PREEMPT
;

ivrrpt_priority
:
   PRIORITY DEC
;

ivrrpt_track
:
   TRACK ivrrpt_track_tail
;

ivrrpt_track_tail
:
   ivrrptt_interface
;

ivrrpt_virtual_address
:
   VIRTUAL_ADDRESS IP_ADDRESS
;

ivrrptt_interface
:
   INTERFACE interface_id ivrrptt_interface_tail
;

ivrrptt_interface_tail
:
   ivrrptti_priority_cost
;

ivrrptti_priority_cost
:
   PRIORITY_COST cost = DEC
;

mfamt_filter
:
   filter
;

mfamt_maximum_labels
:
   MAXIMUM_LABELS num = DEC
;

mfamt_mtu
:
   MTU DEC
;

s_interfaces
:
   INTERFACES
   (
      WILDCARD
      | name = VARIABLE
      | // intentional blank

   ) s_interfaces_tail
;

s_interfaces_tail
:
   it_common
   | it_flexible_vlan_tagging
   | it_unit
;<commit_msg>juniper parse native-vlan-id<commit_after>parser grammar FlatJuniper_interfaces;

import FlatJuniper_common;

options {
   tokenVocab = FlatJuniperLexer;
}

brt_interface_mode
:
   INTERFACE_MODE interface_mode
;

brt_vlan_id_list
:
   VLAN_ID_LIST DEC
;

direction
:
   INPUT
   | INPUT_LIST
   | OUTPUT
   | OUTPUT_LIST
;

famt_bridge
:
   BRIDGE famt_bridge_tail
;

famt_bridge_tail
:
// intentional blank

   | brt_interface_mode
   | brt_vlan_id_list
;

famt_ccc
:
   CCC s_null_filler
;

famt_inet
:
   INET famt_inet_tail
;

famt_inet_tail
:
// intentional blank

   | ifamt_address
   | ifamt_filter
   | ifamt_mtu
   | ifamt_no_redirects
   | ifamt_null
;

famt_inet6
:
   INET6 s_null_filler
;

famt_iso
:
   ISO s_null_filler
;

famt_mpls
:
   MPLS famt_mpls_tail
;

famt_mpls_tail
:
// intentional blank alternative

   | mfamt_filter
   | mfamt_maximum_labels
   | mfamt_mtu
;

filter
:
   FILTER filter_tail
;

filter_tail
:
// intentional blank

   | ft_direction
;

ft_direction
:
   direction name = variable
;

ifamat_master_only
:
   MASTER_ONLY
;

ifamat_preferred
:
   PREFERRED
;

ifamat_primary
:
   PRIMARY
;

ifamat_vrrp_group
:
   VRRP_GROUP name = variable ifamat_vrrp_group_tail
;

ifamat_vrrp_group_tail
:
   ivrrpt_accept_data
   | ivrrpt_preempt
   | ivrrpt_priority
   | ivrrpt_track
   | ivrrpt_virtual_address
;

ifamt_address
:
   ADDRESS IP_PREFIX ifamt_address_tail?
;

ifamt_address_tail
:
   ifamat_master_only
   | ifamat_preferred
   | ifamat_primary
   | ifamat_vrrp_group
;

ifamt_filter
:
   filter
;

ifamt_mtu
:
   it_mtu
;

ifamt_no_redirects
:
   NO_REDIRECTS
;

ifamt_null
:
   (
      SAMPLING
      | SERVICE
   ) s_null_filler
;

interface_mode
:
   TRUNK
;

it_apply_groups
:
   s_apply_groups
;

it_apply_groups_except
:
   s_apply_groups_except
;

it_common
:
   it_apply_groups
   | it_apply_groups_except
   | it_description
   | it_disable
   | it_enable
   | it_family
   | it_mtu
   | it_null
   | it_vlan_id
   | it_vlan_tagging
;

it_description
:
   s_description
;

it_disable
:
   DISABLE
;

it_enable
:
   ENABLE
;

it_family
:
   FAMILY it_family_tail
;

it_family_tail
:
   famt_bridge
   | famt_ccc
   | famt_inet
   | famt_inet6
   | famt_iso
   | famt_mpls
;

it_flexible_vlan_tagging
:
   FLEXIBLE_VLAN_TAGGING
;

it_mtu
:
   MTU size = DEC
;

it_native_vlan_id
:
   NATIVE_VLAN_ID id = DEC
;

it_null
:
   (
      AGGREGATED_ETHER_OPTIONS
      | BANDWIDTH
      | ENCAPSULATION
      | FRAMING
      | GIGETHER_OPTIONS
      | HOLD_TIME
      | INTERFACE_TRANSMIT_STATISTICS
      | MULTISERVICE_OPTIONS
      | NO_TRAPS
      | SONET_OPTIONS
      | TRACEOPTIONS
      | TRAPS
      | TUNNEL
   ) s_null_filler
;

it_unit
:
   UNIT
   (
      WILDCARD
      | num = DEC
   ) it_unit_tail
;

it_unit_tail
:
// intentional blank

   | it_common
;

it_vlan_id
:
   VLAN_ID id = DEC
;

it_vlan_tagging
:
   VLAN_TAGGING
;

ivrrpt_accept_data
:
   ACCEPT_DATA
;

ivrrpt_preempt
:
   PREEMPT
;

ivrrpt_priority
:
   PRIORITY DEC
;

ivrrpt_track
:
   TRACK ivrrpt_track_tail
;

ivrrpt_track_tail
:
   ivrrptt_interface
;

ivrrpt_virtual_address
:
   VIRTUAL_ADDRESS IP_ADDRESS
;

ivrrptt_interface
:
   INTERFACE interface_id ivrrptt_interface_tail
;

ivrrptt_interface_tail
:
   ivrrptti_priority_cost
;

ivrrptti_priority_cost
:
   PRIORITY_COST cost = DEC
;

mfamt_filter
:
   filter
;

mfamt_maximum_labels
:
   MAXIMUM_LABELS num = DEC
;

mfamt_mtu
:
   MTU DEC
;

s_interfaces
:
   INTERFACES
   (
      WILDCARD
      | name = VARIABLE
      | // intentional blank

   ) s_interfaces_tail
;

s_interfaces_tail
:
   it_common
   | it_flexible_vlan_tagging
   | it_native_vlan_id
   | it_unit
;
{'fraction_non_alphanumeric': 0.057134971018492964, 'fraction_numerical': 0.0008280430582390284, 'mean_word_length': 3.0060807075732447, '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': '6101553', 'n_tokens_mistral': 3326, 'n_tokens_neox': 3269, 'n_words': 447}