public void readFromFile(String file) {
		try {
			BufferedReader fin = new BufferedReader(
					new FileReader((file)));
			String line;
			while ((line = fin.readLine()) != null) {
				line = line.replace("\t", "");
				String side[] = line.split("->");
				List<String> rhp = null,lhp = null;
				
				if( side.length == 2 ){
					lhp = new ArrayList<String>(Arrays.asList(side[0].split(" ")));
					lhp.removeAll(Collections.singleton(""));
					
					if( lhp.size() > 1){
						productions.clear();
						System.err.println("Bad production: "+side[0]+" size must be 1.");
						break;
					}
					
					rhp = new ArrayList<String>(Arrays.asList(side[1].split(" ")));
					rhp.removeAll(Collections.singleton(""));
					
					productions.add(new Production(lhp.get(0), rhp));
				}
				else{
					productions.clear();
					System.err.println("Bad line "+line+" size must be 1.");
				}
			}
			fin.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		for(Production p : productions) {
			//System.out.println(p.toString());
			String left = p.getLeft();
			if( !X.contains(p.getLeft())){
				X.add(p.getLeft());
			}
			
			for ( String s: p.getRight()){
				if( !X.contains(s)){
					X.add(s);
				}
			}
		}
		for ( String s: X){
			//System.out.println(s);
		}
	}