Examples of BjorneInterpreter


Examples of org.jnode.shell.bjorne.BjorneInterpreter

        doCompletionTest("echo hi > /", "TETZ");
    }

    private void doCompletionTest(String input, String flags)
        throws ShellSyntaxException, CompletionException {
        BjorneInterpreter interpreter = new BjorneInterpreter();
        for (int i = 0; i <= input.length(); i++) {
            String partial = input.substring(0, i);
            int inWord = 0;
            int wordStart = 0;
            for (int j = 0; j < i; j++) {
                if (Character.isWhitespace(partial.charAt(j))) {
                    inWord++;
                    wordStart = j + 1;
                }
            }
            String lastWord = partial.substring(wordStart);
            Completable completable = interpreter.parsePartial(shell, partial);
            CommandCompletions completions = new CommandCompletions();
            completable.complete(completions, shell);
            Set<String> completionWords = completions.getCompletions();
            switch (flags.charAt(inWord)) {
                case 'T':
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.