Examples of IString


Examples of org.eclipse.imp.pdb.facts.IString

 
  // REFLECT -- copy in PreludeCompiled
  private void writeFile(ISourceLocation sloc, IList V, boolean append, IEvaluatorContext ctx){
    sloc = ctx.getHeap().resolveSourceLocation(sloc);
   
    IString charset = values.string("UTF8");
    if (append) {
      // in case the file already has a encoding, we have to correctly append that.
      InputStream in = null;
      Charset detected = null;
      try {
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IString

  public IValue escape(IString str, IMap substitutions) {
    StringBuilder b = new StringBuilder(str.length() * 2);
   
    int sLength = str.length();
    for (int c = 0; c < sLength; c++) {
      IString chr = str.substring(c, c+1);
      IString sub = (IString)substitutions.get(chr);

      if (sub != null) {
        b.append(sub.getValue());
      }
      else {
        b.append(chr.getValue());
      }
    }
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IString

        return "";
      }
     
      private String replaceEverythingBySpace(String input) {
        StringBuilder sb = new StringBuilder();
        IString is = VF.string(input);
        for (int i = 0; i < is.length(); i++) {
          int ch = is.charAt(i);
          if (ch != ' ' && ch != '\t') {
            sb.append(' ');
          }
          else {
            sb.appendCodePoint(ch);
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IString

    if (logger == null) {
      throw RuntimeExceptionFactory.permissionDenied(
          vf.string("getLog called before startLog"),
          e.getCurrentAST(), null);
    }
    IString result = vf.string(logger.getBuffer().toString());
    Evaluator eval = (Evaluator) e;
    eval.revertToDefaultWriters();
    logger = null;
    return result;
  }
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IString

     
      String vname =  fromName + "_" + to.name + "[" + (from.layer + delta) + "]";
      if(debug)System.err.println("Creating virtual node " + vname + " between " + fromName + " and " + to.name);
      LayeredGraphNode virtual = new LayeredGraphNode(this, vname, hgap/2, vgap);
      IValueFactory vf = ValueFactoryFactory.getValueFactory();
      IString vfVname = vf.string(vname);
      nodes.add(virtual);
     
      registerNodeId(vname, virtual);
     
      LinkedList<LayeredGraphNode> vlayer = layers.get(from.layer+delta);
      virtual.layer = from.layer + delta;
      virtual.pos = vlayer.size();

      virtual.in.add(from);
      virtual.out.add(to);
      from.out.set(from.out.indexOf(to), virtual);
      to.in.set(to.in.indexOf(from), virtual);

      vlayer.add(virtual);

      LayeredGraphEdge old = null;
      for(LayeredGraphEdge e : edges){
        if(debug)System.err.println("Consider edge " + e.getFrom().name + " -> " + e.getTo().name);
        if(e.getFrom() == from && e.getTo() == to){
          old = e;
          if(from == orgFrom){
            orgEdgeLabel = e.getLabel();
          }

          if(debug)System.err.println("Removing old edge " + from.name + " -> " + to.name);
          break;
        }
      }
      //if(old == null)
      //  throw RuntimeExceptionFactory.figureException("Internal error in insertVirtualNode", vfVname, fpa.getRascalContext().getCurrentAST(), fpa.getRascalContext().getStackTrace());

      IString vfGname = vf.string(from.name);
      IString vfOname = vf.string(to.name);
      if(old != null){
        if(old.isReversed()){
          LayeredGraphEdge e1 = new LayeredGraphEdge(this, fpa, old.prop, vfGname, vfVname, old.fromArrow, old.toArrow);
          LayeredGraphEdge e2 = new LayeredGraphEdge(this, fpa, old.prop, vfVname, vfOname, old.fromArrow, old.toArrow);
          e2.label = orgEdgeLabel;
View Full Code Here

Examples of org.jboss.test.jrmp.interfaces.IString

      Object obj = jndiContext.lookup("StatefulSession");
      StatelessSessionHome home = (StatelessSessionHome)obj;
      getLog().debug("Found StatefulSession Home");
      StatelessSession bean = home.create();
      getLog().debug("Created StatefulSession");
      IString echo = bean.copy("jrmp-dl");
      getLog().debug("bean.copy(jrmp-dl) = " + echo);
      Class clazz = echo.getClass();
      CodeSource cs = clazz.getProtectionDomain().getCodeSource();
      URL location = cs.getLocation();
      getLog().debug("IString.class = " + clazz);
      getLog().debug("IString.class location = " + location);
      assertTrue("CodeSource URL.protocol != file", location.getProtocol().equals("file") == false);
View Full Code Here

Examples of org.jboss.test.jrmp.interfaces.IString

   public void testAccess() throws Exception
   {
      InitialContext jndiContext = new InitialContext();
      getLog().debug("Lookup IString");
      Object obj = jndiContext.lookup("test/jrmp/IString");
      IString echo = (IString) obj;
      getLog().debug("found = " + echo);
      Class clazz = echo.getClass();
      CodeSource cs = clazz.getProtectionDomain().getCodeSource();
      URL location = cs.getLocation();
      getLog().debug("IString.class = " + clazz);
      getLog().debug("IString.class location = " + location);
      assertTrue("CodeSource URL.protocol != file", location.getProtocol().equals("file") == false);
View Full Code Here

Examples of org.jboss.test.jrmp.interfaces.IString

   public void testAccess() throws Exception
   {
      InitialContext jndiContext = new InitialContext();
      getLog().debug("Lookup IString");
      Object obj = jndiContext.lookup("test/jrmp/IString");
      IString echo = (IString) obj;
      getLog().debug("found = " + echo);
      Class clazz = echo.getClass();
      CodeSource cs = clazz.getProtectionDomain().getCodeSource();
      URL location = cs.getLocation();
      getLog().debug("IString.class = " + clazz);
      getLog().debug("IString.class location = " + location);
      assertTrue("CodeSource URL.protocol != file", location.getProtocol().equals("file") == false);
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.