public String toString() {
		StringBuffer buffer = new StringBuffer();
		buffer.append(super.toString());
		buffer.append('\n');
		/** print variables. */
		buffer.append("V: ");
		String[] variables = getVariables();
		for (int v = 0; v < variables.length; v++) {
			buffer.append(variables[v]);
			buffer.append(" ");
		}
		buffer.append('\n');

		/** print terminals. */
		buffer.append("T: ");
		String[] terminals = getTerminals();
		for (int t = 0; t < terminals.length; t++) {
			buffer.append(terminals[t]);
			buffer.append(" ");
		}
		buffer.append('\n');

		/** print start variable. */
		buffer.append("S: ");
		buffer.append(getStartVariable());
		buffer.append('\n');

		/** print production rules. */
		buffer.append("P: ");
		buffer.append('\n');
		Production[] productions = getProductions();
		for (int p = 0; p < productions.length; p++) {
			buffer.append(productions[p].toString());
			buffer.append('\n');
		}

		return buffer.toString();
	}