Module: CiscoAclIntp::ParserUtility

Included in:
Parser
Defined in:
lib/cisco_acl_intp/parser_api.rb

Overview

ACL Parser Utilities

Instance Method Summary collapse

Instance Method Details

#acl_arg_err_message(err, pos_str) ⇒ Object

Generate parser error message by AclArgumentError

Parameters:

  • err (AclArgumentError)

    Exception

  • pos_str (String)

    Error position string



60
61
62
63
64
65
66
# File 'lib/cisco_acl_intp/parser_api.rb', line 60

def acl_arg_err_message(err, pos_str)
  [
    'Parse aborted. Found acl argment error:',
    "  #{err.message}",
    "  #{pos_str}"
  ].join("\n")
end

#acl_err_message(err) ⇒ Object

Generate parser error message by AclError

Parameters:



70
71
72
73
74
75
# File 'lib/cisco_acl_intp/parser_api.rb', line 70

def acl_err_message(err)
  [
    'Parse aborted. Found acl error:',
    "  #{err.message}"
  ].join("\n")
end

#err_message(err) ⇒ Object

Generate parser error message by other exception

Parameters:

  • err (StandardError)

    Exception



79
80
81
82
83
84
# File 'lib/cisco_acl_intp/parser_api.rb', line 79

def err_message(err)
  [
    'Parse aborted. Found unknown error:',
    "  #{err.message}"
  ].join("\n")
end

#racc_parse_err_message(err) ⇒ Object

Generate parser error message by Racc::ParseError

Parameters:

  • err (Racc::ParseError)

    Exception



50
51
52
53
54
55
# File 'lib/cisco_acl_intp/parser_api.rb', line 50

def racc_parse_err_message(err)
  [
    'Parse aborted. Found syntax error:',
    "  #{err.message}"
  ].join("\n")
end