app/models/run.rb
# transform a_net expressed by string to array of elements
transform a_net expressed by string to array of elements
transform a_net expressed by string to array of elements
def parse_a_net_to_elem_list(string)
      result, rest = [], string
      until rest.blank? do
        s = StringScanner.new(rest)
        s.scan_until(Scan_rxp)
        elem, rest = s.matched, s.rest
        case elem
          when "(", "[" then content, rest = parse_a_net_to_elem_list(rest) 
          when ")", "]" then break                                    
          else          content = parse_elem(elem)                    
        end
        [result << content, rest]
      end
      [result, rest]
    end
def parse_a_net_to_elem_list ( string ) result , rest = [ ] , string until rest . blank? do s = StringScanner . new ( rest ) s . scan_until ( Scan_rxp ) elem , rest = s . matched , s . rest case elem when "(" , "[" then content , rest = parse_a_net_to_elem_list ( rest ) when ")" , "]" then break else content = parse_elem ( elem ) end [ result << content , rest ] end [ result , rest ] end
transform a_net expressed by string to array of elements
transform a_net expressed by string to array of elements
# start of route or set of routes # end of route or set of routes # atomic element to be parsed
string
<not_specific>