param = getParameter(s.substring(1)); if (param == null) throw new SyntaxError("Unknown Parameter \"" + s + "\""); visitor.visitParameter(param); } else { if (param == null) { param = getAnonymousParameter(); if (param == null) { throw new SyntaxError("Unexpected argument \"" + s + "\""); } else { visitor.visitParameter(param); }
if (param == null) {  if (anonIterator.hasNext()) { param = (Parameter) anonIterator.next(); visitor.visitParameter(param); } else { throw new SyntaxErrorException("Unexpected argument \"" + s + "\""); }
	private synchronized void visitCommandLine(CommandLine cmdLine, CommandLineVisitor visitor) {		clearArguments();		Parameter param = null;		do {			String s = "";			if( cmdLine.hasNext() )				s = cmdLine.next();         // TODO: it didn't handle correctly the parameters starting with "-"             			/*if (s.startsWith("-") && (cmdLine.getTokenType() == CommandLine.LITERAL)) { // we got a named parameter here				if (param != null) // last param takes an argument, but it's not given					throw new SyntaxError("Unexpected Parameter " + s);				param = getParameter(s.substring(1));				if (param == null)					throw new SyntaxError("Unknown Parameter \"" + s + "\"");                                visitor.visitParameter(param);			} else { // we got an argument */				if (param == null) {// must be an argument for an anonymous parameter					param = getAnonymousParameter();					if (param == null) {// but...there are no more of them						throw new SyntaxError("Unexpected argument \"" + s + "\"");					} else {						visitor.visitParameter(param);					}				//}				// no check if there is an argument, as else we would have exited before (Parameter satisfied)				Argument arg = param.getArgument();				String value = visitor.visitValue(s, !cmdLine.hasNext(), cmdLine.getTokenType());				if( value != null )					arg.setValue(value);			}			if (param.isSatisfied())				param = null;		} while (cmdLine.hasNext());	}