private Grammar readGrammar(Document document) {
		Grammar g = new UnboundGrammar();
		NodeList list = document.getDocumentElement().getElementsByTagName(
				RULE_NAME);
		for (int i = 0; i < list.getLength(); i++) {
			Production[] p = createRules(list.item(i));
			for (int j = 0; j < p.length; j++)
				g.addProduction(p[j]);
		}
		return g;
	}