private DefaultTreeModel parseTree(String string, Grammar grammar,
			LLParseTable table, List nodes) {
		int p = 0;
		string = string + "$";
		Stack stack = new Stack();
		MutableTreeNode root = new DefaultMutableTreeNode(grammar
				.getStartVariable());
		stack.push(root);
		nodes.add(root);
		DefaultTreeModel tree = new DefaultTreeModel(root);
		String read = string.substring(p, p + 1);
		p++;
		while (!stack.empty()) {
			String top = stack.peek().toString();
			if (pane.grammar.isTerminal(top)) {
				if (top.equals(read)) {
					stack.pop();
					read = string.substring(p, p + 1);
					p++;
				} else {
					return tree;
				}
			} else if (pane.grammar.isVariable(top)) {
				String entry = get(top, read);
				if (entry == null) {
					return tree;
				} else {
					DefaultMutableTreeNode node = (DefaultMutableTreeNode) stack
							.pop();
					if (entry.length() == 0) {
						MutableTreeNode child = new DefaultMutableTreeNode(
								Universe.curProfile.getEmptyString());
						node.insert(child, 0);
						nodes.add(child);
					} else {
						for (int i = entry.length() - 1; i >= 0; i--) {
							MutableTreeNode child = new DefaultMutableTreeNode(
									entry.substring(i, i + 1));
							node.insert(child, 0);
							stack.push(child);
							nodes.add(child);
						}
					}
				}
			} else {
				// This should never happen.
			}
		}
		return tree;
	}