public void parse(String startState, ILexer lexer) throws EarleyException
	{
		int changed;

		init(startState);

		do
		{
			symbol = lexer.nextSymbol();

			addSeparator();
			int nextSet = states.size();

			scan();
			currentSet = nextSet;
			closure();

			changed = states.size() - currentSet;
		} while ( changed > 0 && !symbol.symbol.equals(ILexer.EOF) );

		// Check for potential problems.
		if ( changed == 0 )
			parseError(lexer);

		if ( changed > 1 )
			ambiguityError(lexer);
	}