Examples of Sexp


Examples of danbikel.lisp.Sexp

       
        Settings.load(settingFilePath);
        Parser parser = new Parser(modelFilePath);
        System.out.print("Parsing input: " + std_input);
        String sent = "(" + std_input.trim() + ")";
        Sexp inpSent = Sexp.read(sent);
        Sexp parsedTree = parser.parse((SexpList) inpSent);
        String parse = parsedTree.toString();
        parse = parse.replaceAll("\\[.*?\\]", "");
        System.out.println("Parsing output: " + parse);
        return parse;
    }
View Full Code Here

Examples of org.renjin.sexp.SEXP

    session.setStdOut(printWriter);
    session.setStdErr(printWriter);
  }

  public EvalResult evaluate(SEXP expression) {
    SEXP exp = session.getTopLevelContext().evaluate(expression);
    return new EvalResult(exp, session.isInvisible());
  }
View Full Code Here

Examples of org.renjin.sexp.SEXP

      try {
       
        parser.parse();
       
        SEXP exp = parser.getResult();
        if(exp == null) {
          continue;
        }
       
        // clean up last warnings from any previous run
        clearWarnings();
       
        SEXP result = topLevelContext.evaluate(exp, global);

        if(!topLevelContext.getSession().isInvisible()) {
          topLevelContext.evaluate(FunctionCall.newCall(Symbol.get("print"), result))
        }
       
View Full Code Here

Examples of org.renjin.sexp.SEXP

      }
    }
  }

  private void printWarnings() {
    SEXP warnings = topLevelContext.getEnvironment().getBaseEnvironment().getVariable(Warning.LAST_WARNING);
    if(warnings != Symbol.UNBOUND_VALUE) {
      topLevelContext.evaluate( FunctionCall.newCall(Symbol.get("print.warnings"), warnings),
        topLevelContext.getEnvironment().getBaseEnvironment());
    }
  }
View Full Code Here

Examples of org.renjin.sexp.SEXP

  public void cleanUpGlobalEnvironment() {
    engine.getSession().getGlobalEnvironment().clear();
  }

  protected final void assertIdentical(String x, String y) {
    SEXP xexp;
    try {
      xexp = (SEXP)engine.eval(x);
    } catch (ScriptException e) {
      throw new RuntimeException("Error evaluating: " + x, e);
    }

    SEXP yexp = null;
    try {
      yexp = (SEXP)engine.eval(y);
    } catch (ScriptException e) {
      throw new RuntimeException("Error evaluating: " + y, e);
    }
View Full Code Here

Examples of org.renjin.sexp.SEXP

  public static GraphicsDevice GEcurrentDevice(@Current Context context) {
    /* If there are no active devices
     * check the options for a "default device".
     * If there is one, start it up. */
    if (context.getSession().getSingleton(GraphicsDevices.class).isEmpty()) {
      SEXP defdev = context.getSession().getSingleton(Options.class).get("device");
      if (isString(defdev) && length(defdev) > 0) {
        SEXP devName = install(CHAR(STRING_ELT(defdev, 0)));
        /*  Not clear where this should be evaluated, since
            grDevices need not be in the search path.
            So we look for it first on the global search path.
        */
        defdev = findVar(devName, context.getGlobalEnvironment());
        if(defdev != R_UnboundValue) {
          PROTECT(defdev = lang1(devName));
          eval(defdev, context, context.getGlobalEnvironment());
          UNPROTECT(1);
        } else {
          /* Not globally visible:
             try grDevices namespace if loaded.
             The option is unlikely to be set if it is not loaded,
             as the default setting is in grDevices:::.onLoad.
          */
          SEXP ns = context.getSession().getNamespaceRegistry().getNamespace("grDevices").getNamespaceEnvironment();
          if(ns != R_UnboundValue &&
                  findVar(devName, ns) != R_UnboundValue) {
            PROTECT(defdev = lang1(devName));
            eval(defdev, context, ns);
            UNPROTECT(1);
View Full Code Here

Examples of org.renjin.sexp.SEXP

    map.put("warnings.length", new IntArrayVector(1000));
    map.put("OutDec", new StringArrayVector("."));
  }

  public SEXP get(String name) {
    SEXP value = map.get(name);
    return value == null ? Null.INSTANCE : value;
  }
View Full Code Here

Examples of org.renjin.sexp.SEXP

    SEXP value = map.get(name);
    return value == null ? Null.INSTANCE : value;
  }
 
  public int getInt(String name, int defaultValue) {
    SEXP value = get(name);
    if(value instanceof AtomicVector && value.length() >= 1) {
      return ((AtomicVector)value).getElementAsInt(0);
    }
    return defaultValue;
  }
View Full Code Here

Examples of org.renjin.sexp.SEXP

    }
    return defaultValue;
  }

  public SEXP set(String name, SEXP value) {
    SEXP old = map.put(name, value);
    return old == null ? Null.INSTANCE : value;
  }
View Full Code Here

Examples of org.renjin.sexp.SEXP

  public void setEnabled(boolean enabled) {
    this.enabled = enabled;
  }
 
  public SEXP getExtends(String className) {
    SEXP value = extendsTable.get(className);
    if(value == null) {
      return Null.INSTANCE;
    } else {
      return value;
    }
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.