Package org.rascalmpl.interpreter.utils

Examples of org.rascalmpl.interpreter.utils.LimitedResultWriter


          + tree.getType() + ")") ;
    }
  }

  public static String yield(IConstructor tree, int limit) throws FactTypeUseException {
    Writer stream = new LimitedResultWriter(limit);
   
    try {
      unparse(tree, stream);
      return stream.toString();
    }
    catch (IOLimitReachedException e) {
      return stream.toString();     
    }
    catch (IOException e) {
      throw new ImplementationError("Method yield failed", e);
    }
  }
View Full Code Here


    return getType().toString() + ": " + value.toString();
  }
 
  public String toString(int length){
    StandardTextWriter stw = new StandardTextWriter(true);
    LimitedResultWriter lros = new LimitedResultWriter(length);
   
    try {
      stw.write(getValue(), lros);
    }
    catch (IOLimitReachedException iolrex){
      // This is fine, ignore.
    }
    catch (IOException ioex) {
      // This can never happen.
    }
   
    return getType().toString() + ": " + lros.toString();
  }
View Full Code Here

TOP

Related Classes of org.rascalmpl.interpreter.utils.LimitedResultWriter

Copyright © 2018 www.massapicom. 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.