Examples of Evaluator


Examples of org.rascalmpl.interpreter.Evaluator

    return evaluator.parseCommands(evaluator.getMonitor(), str.getValue(), loc.getURI());
  }
 
  public IValue parseModule(ISourceLocation loc, IEvaluatorContext ctx) {
    try {
      Evaluator ownEvaluator = getPrivateEvaluator(ctx);
      return ownEvaluator.parseModule(ownEvaluator.getMonitor(), loc.getURI());
    }
    catch (IOException e) {
      throw RuntimeExceptionFactory.io(values.string(e.getMessage()), null, null);
    }
    catch (Throwable e) {
View Full Code Here

Examples of org.rascalmpl.interpreter.Evaluator

      IEvaluator<?> callingEval = ctx.getEvaluator();
     
     
      GlobalEnvironment heap = new GlobalEnvironment();
      ModuleEnvironment root = heap.addModule(new ModuleEnvironment("___full_module_parser___", heap));
      cachedEvaluator = new Evaluator(callingEval.getValueFactory(), callingEval.getStdErr(), callingEval.getStdOut(), root, heap);
      cachedEvaluator.getResolverRegistry().copyResolverRegistries(ctx.getResolverRegistry());
     
      // Update the classpath so it is the same as in the context interpreter.
      cachedEvaluator.getConfiguration().setRascalJavaClassPathProperty(ctx.getConfiguration().getRascalJavaClassPathProperty());
      // clone the classloaders
View Full Code Here

Examples of org.rascalmpl.interpreter.Evaluator

   
    return cachedEvaluator;
  }
 
  public IValue parseModule(IString str, ISourceLocation loc, IEvaluatorContext ctx) {
    Evaluator ownEvaluator = getPrivateEvaluator(ctx);
    return ownEvaluator.parseModule(ownEvaluator.getMonitor(), str.getValue().toCharArray(), loc.getURI());
  }
View Full Code Here

Examples of org.rascalmpl.interpreter.Evaluator

    Evaluator ownEvaluator = getPrivateEvaluator(ctx);
    return ownEvaluator.parseModule(ownEvaluator.getMonitor(), str.getValue().toCharArray(), loc.getURI());
  }
 
  public IValue parseModule(ISourceLocation loc, final IList searchPath, IEvaluatorContext ctx) {
    final Evaluator ownEvaluator = getPrivateEvaluator(ctx);
    final URIResolverRegistry otherReg = ctx.getResolverRegistry();
    URIResolverRegistry ownRegistry = ownEvaluator.getResolverRegistry();
   
    // bridge the resolvers that are not defined in the new Evaluator, but needed here
    for (IValue l : searchPath) {
      String scheme = ((ISourceLocation) l).getURI().getScheme();
      if (!ownRegistry.supportsInputScheme(scheme)) {
        ownRegistry.registerInput(new ResolverBridge(scheme, otherReg));
      }
    }
   
    // add the given locations to the search path
    SourceLocationListContributor contrib = new SourceLocationListContributor("reflective", searchPath);
    ownEvaluator.addRascalSearchPathContributor(contrib);
   
    try {
      return ownEvaluator.parseModule(ownEvaluator.getMonitor(), loc.getURI());
    } catch (IOException e) {
      throw RuntimeExceptionFactory.io(values.string(e.getMessage()), null, null);
    }
    catch (Throwable e) {
      throw RuntimeExceptionFactory.javaException(e, null, null);
    }
    finally {
      ownEvaluator.removeSearchPathContributor(contrib);
    }
  }
View Full Code Here

Examples of org.rascalmpl.interpreter.Evaluator

    for(int i = 0; i < N; i++) {
      final int threadNumber = i;
      threads[i] = new Thread(new Runnable() {
        @Override
        public void run() {
          Evaluator eval;
          synchronized(evaluators) {
            eval = evaluators[threadNumber];
          }
          try {
            boolean result = runner.run(eval);
View Full Code Here

Examples of org.teiid.query.eval.Evaluator

        ElementSymbol e1 = new ElementSymbol("e1"); //$NON-NLS-1$
        elementMap.put(e1, new Integer(0));
       
        List tuple = Arrays.asList(new String[]{"a"}); //$NON-NLS-1$
        CommandContext cc = new CommandContext();
        assertEquals(expectedResult, new Evaluator(elementMap, null, cc) {
          @Override
          protected ValueIterator evaluateSubquery(
              SubqueryContainer container, List tuple)
              throws TeiidProcessingException, BlockedException,
              TeiidComponentException {
View Full Code Here

Examples of org.teiid.query.eval.Evaluator

    private QueryTupleSource(TupleBrowser browser, Map map,
        List<? extends SingleElementSymbol> projectedCols, Criteria condition) {
      this.browser = browser;
      this.indexes = RelationalNode.getProjectionIndexes(map, projectedCols);
      this.eval = new Evaluator(map, null, null);
      this.condition = condition;
      this.project = shouldProject();
      this.reserved = reserveBuffers();
      if (updatable) {
        lock.readLock().lock();
View Full Code Here

Examples of org.teiid.query.eval.Evaluator

   
    protected TupleBuffer undoLog;

    UpdateProcessor(Criteria crit, TupleSource ts) throws TeiidComponentException {
      this.ts = ts;
      this.eval = new Evaluator(columnMap, null, null);
      this.crit = crit;
      this.undoLog = bm.createTupleBuffer(columns, sessionID, TupleSourceType.PROCESSOR);
    }
View Full Code Here

Examples of org.teiid.query.eval.Evaluator

        Criteria actual = null;
        // rewrite
        try {
          ArrayList<Boolean> booleanVals = new ArrayList<Boolean>(tuples.size());
          for (List<Object> tuple : tuples) {
              booleanVals.add(new Evaluator(elements, null, null).evaluate(origCrit, tuple));
      }
            actual = QueryRewriter.rewriteCriteria(origCrit, null, null, metadata);
            assertEquals("Did not rewrite correctly: ", expectedCrit, actual); //$NON-NLS-1$
            for (int i = 0; i < tuples.size(); i++) {
              assertEquals(tuples.get(i).toString(), booleanVals.get(i), new Evaluator(elements, null, null).evaluate(actual, tuples.get(i)));
      }
        } catch(TeiidException e) {
          throw new RuntimeException(e);
        }
        return actual;
View Full Code Here

Examples of org.teiid.query.eval.Evaluator

    private QueryRewriter(QueryMetadataInterface metadata,
      CommandContext context, CreateUpdateProcedureCommand procCommand) {
    this.metadata = metadata;
    this.context = context;
    this.procCommand = procCommand;
    this.evaluator = new Evaluator(Collections.emptyMap(), null, context);
  }
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.