public HashSet<QScannerMatchData> runPrefixScan(ParserState state,
			                                        ReadOnlyParseTable table,
			                                        InputPosition whence,
			                                        Collection<Terminal> shiftable,
			                                        ArrayList<QScannerMatchData> layouts,
			                                        boolean runDisjoint)
	throws IOException,CopperException
	{
		if(!table.hasPrefixes(state.getStatenum()))
		{
			if(!runDisjoint) return runScan(whence,shiftable,layouts);
			else return runScan(whence,table.getShiftableUnion(),layouts);
		}
		Collection<Terminal> shiftablePrefixes = table.getPrefixes(state.getStatenum()); 
		HashSet<QScannerMatchData> matchingPrefixes = runScan(whence,shiftablePrefixes,layouts);
		if(matchingPrefixes.isEmpty())
		{
			if(!runDisjoint) return runScan(whence,shiftable,layouts);
			else return runScan(whence,table.getShiftableUnion(),layouts);
		}
		if(matchingPrefixes.size() > 1)
		{
			return matchingPrefixes;
		}
		QScannerMatchData prefixD = matchingPrefixes.iterator().next(); 
		Terminal prefix = prefixD.getToken();
		layouts.add(prefixD);
		shiftable = table.getShiftableFollowingPrefix(state.getStatenum(),prefix);
		whence = InputPosition.advance(whence,prefix.getLexeme().length(),prefix.getLexeme());
		if(!runDisjoint) return runScan(whence,shiftable,layouts);
		else return runScan(whence,table.getShiftableUnion(),layouts);
	}