public OptionTable(String str, String[] keys) {
		try {
			StreamTokenizer tokenizer = createTokenizer(str);
			int ttype = tokenizer.nextToken();
			while (ttype != StreamTokenizer.TT_EOF) {
				if (ttype != StreamTokenizer.TT_WORD) {
					throw new ErrorException("Illegal option string: " + str);
				}
				String key = tokenizer.sval;
				if (keys != null && !keyExists(key, keys)) {
					throw new ErrorException("Unrecognized option: " + key);
				}
				ttype = tokenizer.nextToken();
				if (ttype == '=') {
					ttype = tokenizer.nextToken();
					if (ttype != StreamTokenizer.TT_WORD && ttype != '"' && ttype != '\'') {
						throw new ErrorException("Illegal option string: " + str);
					}
					put(key, tokenizer.sval);
					ttype = tokenizer.nextToken();
				} else {
					put(key, "");
				}
			}
		} catch (IOException ex) {
			throw new ErrorException("Illegal option string: " + str);
		}
	}