public void resolveSingulars()	{
		Rule singular;
		while ((singular = removeSingular()) != null)	{
			String substitute = singular.getNonterminal();

			for (int i = 0; i < size(); i++)	{	// substitute rules containing the singular
				Rule rule = getRule(i);

				for (int j = 0; j < rule.rightSize(); j++)
					if (rule.getRightSymbol(j).equals(substitute))
						rule.setRightSymbol(singular.getRightSymbol(0), j);
			}
		}
	}