Method: CiscoAclIntp::Scanner#scan_match_common

Defined in:
lib/cisco_acl_intp/scanner.rb

#scan_match_commonBoolean (private)

Scanner of common tokens

Returns:

  • (Boolean)

    if line matched tokens



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/cisco_acl_intp/scanner.rb', line 123

def scan_match_common
  case
  when @ss.scan(/(\d+)\s/)
    ## Number
    @line_queue.push [:NUMBER, @ss[1].to_i]
  when @ss.scan(/([\+\-]?#{STR_REGEXP})/)
    ## Tokens (echo back)
    ## defined in module SpecialTokenHandler
    ## plus/minus used in tcp flag token e.g. +syn -ack
    @line_queue.push token_list(@ss[1])
  else
    ## do not match any?
    ## then scanned whole line and
    ## put in @line_queue as unknown.
    @ss.scan(/(.*)$/) # match all
    @line_queue.push [:UNKNOWN, @ss[1]]
  end
  @ss.matched?
end