Examples of Repl


Examples of org.crsh.lang.spi.Repl

      InvocationContext<Object> context,
      @Argument(completer = ReplCompleter.class)
      @Usage("the optional repl name")
      String name) throws Exception {
    ShellSession session = (ShellSession)context.getSession();
    Repl current = session.getRepl();
    if (name != null) {
      if (name.equals(current.getLanguage().getName())) {
        context.provide("Using repl " + name);
      } else {
        Repl found = null;
        for (Language lang : session.getContext().getPlugins(Language.class)) {
          if (lang.getName().equals(name)) {
            if (lang.isActive()) {
              found = lang.getRepl();
              if (found != null) {
                break;
              } else {
                throw new ScriptException("Language " + name + " does not provide a repl");
              }
            } else {
              throw new ScriptException("Language " + name + " not active");
            }
          }
        }
        if (found != null) {
          session.setRepl(found);
          context.provide("Using repl " + name);
        } else {
          throw new ScriptException("Repl " + name + " not found");
        }
      }
    } else {

      //
      LinkedHashMap<Repl, Boolean> repls = new LinkedHashMap<Repl, Boolean>();
      repls.put(ScriptRepl.getInstance(), true);
      for (Language lang : session.getContext().getPlugins(Language.class)) {
        Repl repl = lang.getRepl();
        if (repl != null) {
          repls.put(repl, lang.isActive());
        }
      }
View Full Code Here

Examples of org.renjin.studio.console.Repl

    StudioSession session = new StudioSession();
   
    MainFrame mainFrame = new MainFrame(session);
   

    Repl interpreter = new Repl( mainFrame.getConsole(), session );
    new Thread ( interpreter ).start();

 
  }
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.