Adds OPT_X | OPT_HEX option to OptionParser, with multiple arguments.

@param parser OptionParser to be modified
@param required Tells if this option is required or optional
972313
public static void acceptsHex(OptionParser parser) {
        parser.acceptsAll(Arrays.asList(OPT_X, OPT_HEX), "fetch key/entry by key value of hex type")
              .withRequiredArg()
              .describedAs("key-list")
              .withValuesSeparatedBy(',')
              .ofType(String.class);
    }
447569
public final void addParser(@NotNull final ParserConfig parser) {
        Contract.requireArgNotNull("parser", parser);
        if (parsers == null) {
            parsers = new Parsers();
        }
        parsers.addParser(parser);
    }
1130055
function choice ( parserSyntax ) {
				return function () {
					var i, result;

					for ( i = 0; i < parserSyntax.length; i++ ) {
						result = parserSyntax[i]();

						if ( result !== null ) {
							return result;
						}
					}

					return null;
				};
			}
471118
private void appendOption(StringBuffer buff, Option option, boolean required)
    {
        if (!required)
        {
            buff.append("[");
        }

        if (option.getOpt() != null)
        {
            buff.append("-").append(option.getOpt());
        }
        else
        {
            buff.append("--").append(option.getLongOpt());
        }
        
        // if the Option has a value and a non blank argname
        if (option.hasArg() && (option.getArgName() == null || option.getArgName().length() != 0))
        {
            buff.append(option.getOpt() == null ? longOptSeparator : " ");
            buff.append("<").append(option.getArgName() != null ? option.getArgName() : getArgName()).append(">");
        }
        
        // if the Option is not a required option
        if (!required)
        {
            buff.append("]");
        }
    }
98710
function (parserOptions) {
            var me = this;
            if (parserOptions) {
                _gpfArrayForEach([
                    "header",
                    "separator",
                    "quote",
                    "newLine"
                ], function (optionName) {
                    if (parserOptions[optionName]) {
                        me["_" + optionName] = parserOptions[optionName];
                    }
                });
            }
        }
828827
public final void mREQUIRED() throws RecognitionException {
        try {
            int _type = REQUIRED;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // com/dyuproject/protostuff/parser/ProtoLexer.g:123:5: ( 'required' )
            // com/dyuproject/protostuff/parser/ProtoLexer.g:123:9: 'required'
            {
            match("required"); 


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
29124
private void setup (Parser parser)
    {
    if (parser == null) {
        throw new
        NullPointerException("Parser argument must not be null");
    }
    this.parser = parser;
    atts = new AttributesImpl();
    nsSupport = new NamespaceSupport();
    attAdapter = new AttributeListAdapter();
    }
753825
public void addRequirement(String requirement) {
		if (!Strings.isEmpty(requirement)) {
			if (this.requirements == null) {
				this.requirements = new ArrayList<>();
			}
			this.requirements.add(requirement);
		}
	}
27001
protected AstNode add(boolean required) throws ScanException, ParseException {
		AstNode v = mul(required);
		if (v == null) {
			return null;
		}
		while (true) {
			switch (token.getSymbol()) {
				case PLUS:
					consumeToken();
					v = createAstBinary(v, mul(true), AstBinary.ADD);
					break;
				case MINUS:
					consumeToken();
					v = createAstBinary(v, mul(true), AstBinary.SUB);
					break;
				case EXTENSION:
					if (getExtensionHandler(token).getExtensionPoint() == ExtensionPoint.ADD) {
						v = getExtensionHandler(consumeToken()).createAstNode(v, mul(true));
						break;
					}
				default:
					return v;
			}
		}
	}
264290
function goBasicParser(optstring, argv, optind)
{
	var ii;

	ASSERT(optstring || optstring === '', 'optstring is required');
	ASSERT(optstring.constructor === String, 'optstring must be a string');
	ASSERT(argv, 'argv is required');
	ASSERT(argv.constructor === Array, 'argv must be an array');

	this.gop_argv = new Array(argv.length);
	this.gop_options = {};
	this.gop_aliases = {};
	this.gop_optind = optind !== undefined ? optind : 2;
	this.gop_subind = 0;

	for (ii = 0; ii < argv.length; ii++) {
		ASSERT(argv[ii].constructor === String,
		    'argv must be string array');
		this.gop_argv[ii] = argv[ii];
	}

	this.parseOptstr(optstring);
}
165890
final boolean withErrorSuppressed(Parser<?> parser) {
    boolean oldValue = errorSuppressed;
    errorSuppressed = true;
    boolean ok = parser.apply(this);
    errorSuppressed = oldValue;
    return ok;
  }
867411
public void addLanguage( QueryParser languageParser ) {
        CheckArg.isNotNull(languageParser, "languageParser");
        this.parsers.put(languageParser.getLanguage().trim().toLowerCase(), languageParser);
    }
173142
protected void configureParser(LSParser parser) {
        for (Map.Entry<String, Object> setting : parseSettings.entrySet()) {
            setParserConfigParameter(parser, setting.getKey(), setting.getValue());
        }
    }
341549
@SuppressWarnings("unchecked")
    protected OptionHandler createOptionHandler(CmdLineParser parser, OptionDef o, Setter setter) {
        checkNonNull(o, "CmdLineParser");
        checkNonNull(o, "OptionDef");
        checkNonNull(setter, "Setter");

        Class<? extends OptionHandler> h = o.handler();
        if(h==OptionHandler.class) {
            // infer the type
            Class<?> t = setter.getType();

            // enum is the special case
            if(Enum.class.isAssignableFrom(t))
                return new EnumOptionHandler(parser,o,setter,t);

            OptionHandlerFactory factory = handlers.get(t);
            if (factory==null)
                throw new IllegalAnnotationError(Messages.UNKNOWN_HANDLER.format(t));

            return factory.getHandler(parser, o, setter);
        } else {
            // explicit handler specified
            return new DefaultConstructorHandlerFactory(h).getHandler(parser, o, setter);
        }
    }
264246
@Override
    public CommandLineParser addOption(String name, String description) {
        int length = name.length();
        if (length > longestOptionNameLength) {
            longestOptionNameLength = length;
        }
        declaredOptions.put(name, new Option(name, description));
        return this;
    }
634576
public final Parser<T> optional(T defaultValue) {
    return Parsers.or(this, Parsers.constant(defaultValue));
  }
87903
public void addFieldParser (String property, FieldParser parser)
    {
        if (_parsers == null) {
            _parsers = new HashMap<String,FieldParser>();
        }
        _parsers.put(property, parser);
    }