private static ArrayList<Line> readLineInfo(Scanner input, HashMap<String, BusStop> busStops) throws Exception
   {
        String temp, lineNo;
        int period;
        Time start, last;
        ArrayList<Line> lines = new ArrayList();
        
        input.useDelimiter("[:=<>,\\s]+");
        while (input.hasNext())
        {
            temp = input.next();
            if (temp.compareTo("line") != 0)
               throw new Exception(temp + " when keyword line is expected");
            lineNo = input.next();
            temp = input.next();
            if (temp.compareTo("route") != 0)
               throw new Exception(temp + " when keyword route is expected");
            ArrayList<BusStop> route = new ArrayList();
            ArrayList<Integer> timepoints = new ArrayList();
            while (!input.hasNext("start"))
            {
                  temp = input.next();
                  if (busStops.containsKey(temp))
                     route.add(busStops.get(temp)); 
                  else
                     throw new Exception("Busstop " + temp + " not defined!");
                  timepoints.add(input.nextInt());   
            }
            temp = input.next();      
            if (temp.compareTo("start") != 0)
               throw new Exception(temp + " when keyword start is expected");
            start = new Time(input.nextInt(), input.nextInt());
            temp = input.next();
            if (temp.compareTo("last") != 0)
               throw new Exception(temp + " when keyword last is expected");
            last = new Time(input.nextInt(), input.nextInt());
            temp = input.next();
            if (temp.compareTo("period") != 0)
               throw new Exception(temp + " when keyword period is expected");
            period = input.nextInt();           
            Line line = new Line(lineNo,route.get(0), route.get(route.size() - 1), start, last, period); 
            for(int i=0; i < route.size(); i++)
               line.addNextBusStop(route.get(i), timepoints.get(i));
            lines.add(line);    
        }        
        return lines;
   }