public Grammar(String fileName) throws FileNotFoundException {
		m = new HashMap<String, Rule>();
		File file = new File(fileName);
		Scanner s = new Scanner(file);
		keyCounter = 0;

		while (s.hasNextLine()) { // loop in a loop, outside to go through and make rules
			String str = s.nextLine();
			
			//check to get the key & create a new rule
			if (str.startsWith("<")) {
				String key = str;
				keyCounter++;
				Rule r = new Rule();
				 //System.out.println(str);
				while (!s.nextLine().equals("")) { // inside for the productions for each loop
					s.nextLine();
					// System.out.println(str);
					Productions nProduction = new Productions(str);
					r.addProductions(nProduction);
					//System.out.println(r.alProductions.size());
					// r.addProductions(nProduction.toString());
				}
				m.put(key, r);
			}	
			// System.out.println(m.toString());
		}
		s.close();
	}