public Transition getTransitionForProduction(Production production) {
		ProductionChecker pc = new ProductionChecker();
		String lhs = production.getLHS();
		State from = getStateForVariable(lhs);

		/** if of the form A->xB */
		if (ProductionChecker.isRightLinearProductionWithVariable(production)) {
			String[] variables = production.getVariablesOnRHS();
			String variable = variables[0];
			State to = getStateForVariable(variable);
			String rhs = production.getRHS();
			String label = rhs.substring(0, rhs.length() - 1);
			FSATransition trans = new FSATransition(from, to, label);
			return trans;
		}
		/** if of the form A->x */
		else if (ProductionChecker.isLinearProductionWithNoVariable(production)) {
			String transLabel = production.getRHS();
			State finalState = getStateForVariable(FINAL_STATE);
			FSATransition ftrans = new FSATransition(from, finalState,
					transLabel);
			return ftrans;
		}
		return null;
	}