private boolean checkforLinearity(Production[] p)
	{
		int count=0;
		for (int i=0; i<p.length; i++)
		{
			if (ProductionChecker.isRightLinear(p[i]))
					count++;
		}
		if (count==p.length)
		{
			JOptionPane.showMessageDialog(environment.getComponent(0), "This is a right-linear Grammar (Regular Grammar and Context-Free Grammar)", "Grammar Type"
					, JOptionPane.INFORMATION_MESSAGE);
			return true;
		}
		else
		{
			count=0;
			for (int i=0; i<p.length; i++)
			{
				if (ProductionChecker.isLeftLinear(p[i]))
						count++;
			}
			if (count==p.length)
			{
				JOptionPane.showMessageDialog(environment.getComponent(0), "This is a left-linear Grammar (Regular Grammar and Context-Free Grammar)", "Grammar Type"
						, JOptionPane.INFORMATION_MESSAGE);
				return true;
			}
		}
		return false;
	}