private void initializeChomskyMap(Grammar g) {
	//	//System.out.println("Chomsky = "+g);
		CNFConverter converter = new CNFConverter(g);
		
		Production[] p = g.getProductions();
		boolean chomsky = true;
		for (int i = 0; i < p.length; i++)
			chomsky &= converter.isChomsky(p[i]);
		
		if (!chomsky) {
			
			myCNFMap=new HashMap <Production, ArrayList <Production>>();
			GrammarEnvironment env=new GrammarEnvironment(new GrammarInputPane(g));
			ChomskyPane cp = new ChomskyPane(env, g);
			ArrayList <Production> resultList=new ArrayList <Production>();
			cp.doAll();
			for (int i=0; i<p.length; i++)
			{
				myTempCNF=new ArrayList <Production>();
				CNFConverter cv = new CNFConverter(g);
				
				convertToCNF(cv, p[i]);
				myCNFMap.put(p[i], myTempCNF);
				resultList.addAll(myCNFMap.get(p[i]));
			}
		//	System.out.println("Initial CNF Map = "+myCNFMap);

			//System.out.println(resultList);
			Production[] pp=new Production[resultList.size()];
			HashMap <Production, Production> originalToCNF=new HashMap <Production, Production>();
			for (int i=0; i<pp.length; i++)
			{
				pp[i]=resultList.get(i);
			}
			pp=converter.convert(pp);
			//System.out.println("CONverted : "+Arrays.asList(pp));
			for (int i=0; i<pp.length; i++)
			{
				originalToCNF.put(resultList.get(i), pp[i]);
			}
		//	System.out.println("ORiginal = "+originalToCNF);
			finalizeCNFMap(originalToCNF);
			g=cp.getGrammar();
			
		//	System.out.println("FINAL CNF Map = "+myCNFMap);
			
		}
	//	System.out.println(g);
	}