private void processParameter(Parameter param, 
        String valueToParse) {

        // if this argument has already been parsed at least once...
        if (result.getObject(param.getID()) != null) {
            if (((param instanceof FlaggedOption)
                && (!((FlaggedOption) param).allowMultipleDeclarations()))
                || (param instanceof Switch)
				|| (param instanceof QualifiedSwitch)
                || ((param instanceof UnflaggedOption)
                && (!((UnflaggedOption) param).isGreedy()))) {
                result.addException(param.getID(), 
                    new IllegalMultipleDeclarationException(param.getID()));
            }
        }

        if (param instanceof QualifiedSwitch) {
        	result.registerQualifiedSwitch(param.getID(), true);
        }
        
        try {
            result.add(param.getID(), param.parse(valueToParse));
        }
        catch (ParseException pe) {
            result.addException(param.getID(), pe);
        }
    }