<commit_before>parser grammar CiscoGrammar;

import
CiscoGrammarCommonParser, CiscoGrammar_acl, CiscoGrammar_bgp, CiscoGrammar_interface, CiscoGrammar_ospf, CiscoGrammar_routemap;

options {
   superClass = 'batfish.grammar.BatfishParser';
   tokenVocab = CiscoGrammarCommonLexer;
}

@header {
package batfish.grammar.cisco;
}

address_family_vrf_stanza
:
   ADDRESS_FAMILY ~NEWLINE* NEWLINE null_block_substanza* EXIT_ADDRESS_FAMILY
   NEWLINE closing_comment
;

banner_stanza
:
   BANNER
   (
      (MOTD ESCAPE_C ~ESCAPE_C* ESCAPE_C)
      |
      (LOGIN  ~EOF_LITERAL* EOF_LITERAL)
   ) NEWLINE
;

certificate_stanza
:
   CERTIFICATE ~QUIT* QUIT NEWLINE
;

cisco_configuration
:
   (
      sl += stanza
   )+ COLON? END? .*? EOF
;

hostname_stanza
:
   HOSTNAME name = ~NEWLINE* NEWLINE
;

ip_default_gateway_stanza
:
   IP DEFAULT_GATEWAY gateway = IP_ADDRESS
;

ip_route_stanza
:
   IP ROUTE
   (
      (
         address = IP_ADDRESS mask = IP_ADDRESS
      )
      | prefix=IP_PREFIX
   )<commit_msg>don't allow arbitrary text at end of cisco_configuration<commit_after>parser grammar CiscoGrammar;

import
CiscoGrammarCommonParser, CiscoGrammar_acl, CiscoGrammar_bgp, CiscoGrammar_interface, CiscoGrammar_ospf, CiscoGrammar_routemap;

options {
   superClass = 'batfish.grammar.BatfishParser';
   tokenVocab = CiscoGrammarCommonLexer;
}

@header {
package batfish.grammar.cisco;
}

address_family_vrf_stanza
:
   ADDRESS_FAMILY ~NEWLINE* NEWLINE null_block_substanza* EXIT_ADDRESS_FAMILY
   NEWLINE closing_comment
;

banner_stanza
:
   BANNER
   (
      (MOTD ESCAPE_C ~ESCAPE_C* ESCAPE_C)
      |
      (LOGIN  ~EOF_LITERAL* EOF_LITERAL)
   ) NEWLINE
;

certificate_stanza
:
   CERTIFICATE ~QUIT* QUIT NEWLINE
;

cisco_configuration
:
   (
      sl += stanza
   )+ COLON? END? NEWLINE* EOF
;

hostname_stanza
:
   HOSTNAME name = ~NEWLINE* NEWLINE
;

ip_default_gateway_stanza
:
   IP DEFAULT_GATEWAY gateway = IP_ADDRESS
;

ip_route_stanza
:
   IP ROUTE
   (
      (
         address = IP_ADDRESS mask = IP_ADDRESS
      )
      | prefix=IP_PREFIX
   )
{'fraction_non_alphanumeric': 0.07412790697674419, 'fraction_numerical': 0.0, 'mean_word_length': 3.8135198135198136, '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': '2139983', 'n_tokens_mistral': 853, 'n_tokens_neox': 806, 'n_words': 138}