Examples of ArgumentBundle


Examples of org.jnode.shell.syntax.ArgumentBundle

    @Test
    public void testStatefullParsing3() throws NoTokensAvailableException, CommandSyntaxException {
        IntegerArgument intArg = new IntegerArgument("intArg", Argument.MULTIPLE);
        FileArgument fileArg = new FileArgument("fileArg", Argument.MULTIPLE);
        ArgumentBundle bundle = new ArgumentBundle(intArg, fileArg);

        // <start> :: = <<intArg>> | <<fileArg>>
        MuSyntax syntax = new MuAlternation(new MuArgument("intArg"), new MuArgument("fileArg"));
        MuParser parser = new MuParser();
        CommandLine cl;
View Full Code Here

Examples of org.jnode.shell.syntax.ArgumentBundle

    @Test
    public void testStatefullParsing4() throws NoTokensAvailableException, CommandSyntaxException {
        IntegerArgument intArg = new IntegerArgument("intArg", Argument.MULTIPLE);
        FileArgument fileArg = new FileArgument("fileArg", Argument.MULTIPLE);
        ArgumentBundle bundle = new ArgumentBundle(intArg, fileArg);

        // <root> ::= <<fileArg>> | ( <<intArg>> <root> )
        MuSyntax syntax =
                new MuAlternation("root", new MuArgument("fileArg"), new MuSequence(new MuArgument(
                        "intArg"), new MuBackReference("root")));
View Full Code Here

Examples of org.jnode.shell.syntax.ArgumentBundle

    @Test
    public void testStatefullParsing5() throws NoTokensAvailableException, CommandSyntaxException {
        IntegerArgument intArg = new IntegerArgument("intArg", Argument.MULTIPLE);
        FileArgument fileArg = new FileArgument("fileArg", Argument.MULTIPLE);
        ArgumentBundle bundle = new ArgumentBundle(intArg, fileArg);

        // <root> ::= ( <<intArg>> <root> ) | <<fileArg>>
        MuSyntax syntax =
                new MuAlternation("root", new MuSequence(new MuArgument("intArg"),
                        new MuBackReference("root")), new MuArgument("fileArg"));
View Full Code Here

Examples of org.jnode.shell.syntax.ArgumentBundle

    @Test
    public void testStatefullParsing6() throws NoTokensAvailableException, CommandSyntaxException {
        EnumArgument<Big> bigArg = new BigArgument("bigArg", Argument.MULTIPLE);
        EnumArgument<Small> smallArg = new SmallArgument("smallArg", Argument.MULTIPLE);
        IntegerArgument intArg = new IntegerArgument("intArg", Argument.MULTIPLE);
        ArgumentBundle bundle = new ArgumentBundle(intArg, smallArg, bigArg);

        // <root> ::= ( ( <<intArg>> <root> ) | ( <<bigArg>> <<smallArg>> ) ) |
        // ( ( <<intArg>> <root> ) | <<bigArg>> ) )
        MuSyntax syntax = new MuAlternation("root", new MuAlternation(new MuSequence(new MuArgument("intArg"),
            new MuBackReference("root")), new MuSequence(new MuArgument("bigArg"), new MuArgument("smallArg"))),
View Full Code Here

Examples of org.jnode.shell.syntax.ArgumentBundle

        new PowersetSyntax(new OptionSyntax("intArg", 'i'), new OptionSyntax("fileArg", 'f'));
    }

    @org.junit.Test
    public void testFormat() {
        ArgumentBundle bundle = new Test().getArgumentBundle();
        Syntax syntax1 =
                new PowersetSyntax(new OptionSyntax("intArg", 'i'),
                        new OptionSyntax("fileArg", 'f'));
        Assert.assertEquals("[ ( -i <intArg> ) | ( -f <fileArg> ) ] ...", syntax1.format(bundle));
    }
View Full Code Here

Examples of org.jnode.shell.syntax.ArgumentBundle

            Class<?> cls = aliasMgr.getAliasClass(cmd);
            if (Command.class.isAssignableFrom(cls)) {
                return new CommandInfo(cls, cmd, syntaxBundle, aliasMgr.isInternal(cmd));
            } else {
                // check if this alias has a bare command definition
                ArgumentBundle argBundle = getSyntaxManager().getArgumentBundle(cmd);
                return new CommandInfo(cls, cmd, syntaxBundle, argBundle);
            }
        } catch (ClassNotFoundException ex) {
            throw new ShellInvocationException("Cannot load the command class for alias '" + cmd + "'", ex);
        } catch (NoSuchAliasException ex) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.