Method: CiscoAclIntp::Scanner#scan_one_line

Defined in:
lib/cisco_acl_intp/scanner.rb

#scan_one_line(line) ⇒ Array (private)

Scan a line

Parameters:

  • line (String)

    ACL String

Returns:

  • (Array)

    Scanned tokens array (Queue)



57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/cisco_acl_intp/scanner.rb', line 57

def scan_one_line(line)
  @ss = StringScanner.new(line)
  @line_queue = []
  until @ss.eos?
    case
    when scan_match_arg_tokens
    when scan_match_acl_header
    when scan_match_ipaddr
    else scan_match_common
    end
  end
  @line_queue.push [:EOS, nil] # Add end-of-string
end