Examples of Accumulator


Examples of org.drools.spi.Accumulator

            Map<String, Declaration> sourceOuterDeclr = source.getOuterDeclarations();              

            Map<String, Class<?>> declarationClasses = context.getDeclarationResolver().getDeclarationClasses( decls );
            declarationClasses.putAll( context.getDeclarationResolver().getDeclarationClasses( sourceOuterDeclr ) );
           
            Accumulator accumulator = null;
                       
            BoundIdentifiers boundIds = new BoundIdentifiers( declarationClasses, context.getPackageBuilder().getGlobals() ) ;         
           
            if ( accumDescr.isExternalFunction() ) {
                // build an external function executor
View Full Code Here

Examples of org.drools.spi.Accumulator

            MVELDialect dialect = (MVELDialect) context.getDialect();

            final Declaration[] sourceDeclArr = (Declaration[]) source.getOuterDeclarations().values().toArray( new Declaration[source.getOuterDeclarations().size()] );

            Accumulator accumulator = null;
            Declaration[] declarations = null;

            if ( accumDescr.isExternalFunction() ) {
                // build an external function executor
                Map<String, Class< ? >> declarationsMap = context.getDeclarationResolver().getDeclarationClasses( context.getRule() );
View Full Code Here

Examples of org.drools.spi.Accumulator

            MVELDialect dialect = (MVELDialect) context.getDialect();

            final Declaration[] sourceDeclArr = (Declaration[]) source.getOuterDeclarations().values().toArray( new Declaration[ source.getOuterDeclarations().size() ] );

            Accumulator accumulator = null;
            Declaration[] declarations = null;

            if ( accumDescr.isExternalFunction() ) {
                // build an external function executor
                final Dialect.AnalysisResult analysis = dialect.analyzeExpression( context,
View Full Code Here

Examples of org.drools.spi.Accumulator

        final DroolsMVELFactory factory = new DroolsMVELFactory( context.getDeclarationResolver().getDeclarations(),
                                                                 source.getOuterDeclarations(),
                                                                 context.getPkg().getGlobals() );

        Accumulator accumulator = null;
        Declaration[] declarations = null;

        if ( accumDescr.isExternalFunction() ) {
            // build an external function executor
            final Dialect.AnalysisResult analysis = dialect.analyzeExpression( context,
View Full Code Here

Examples of org.drools.spi.Accumulator

                                                                           4,
                                                                           false );

            AccumulateFunction accFunction = new SumAccumulateFunction();

            Accumulator accumulator = new MVELAccumulatorFunctionExecutor( compilationUnit,
                                                                           accFunction );
            ((MVELCompileable) accumulator).compile( Thread.currentThread().getContextClassLoader() );

            Accumulate accumulate = new Accumulate( sourcePattern,
                                                    new Declaration[]{}, // required declaration
View Full Code Here

Examples of org.rascalmpl.interpreter.Accumulator

      if (__eval.__getAccumulators().empty()) {
        throw new UnguardedAppend(this);
      }
      if (!this.getDataTarget().isEmpty()) {
        String label = org.rascalmpl.interpreter.utils.Names.name(this.getDataTarget().getLabel());
        Accumulator accu = findDataTarget(__eval, label);
        if (accu == null) {
          throw new UnguardedAppend(this); // TODO: better error
        }
        return accu;
      }
View Full Code Here

Examples of org.rascalmpl.interpreter.Accumulator

        String label) {
      Stack<Accumulator> accus = __eval.__getAccumulators();
     
      // Search backwards, to allow nested fors with same label.
      for (int i = accus.size() - 1; i >= 0; i--) {
        Accumulator accu = accus.get(i);
        if (accu.hasLabel(label)) {
          return accu;
        }
      }
      return null;
    }
View Full Code Here

Examples of org.rascalmpl.interpreter.Accumulator

    public Result<IValue> interpret(IEvaluator<Result<IValue>> __eval) {

      __eval.setCurrentAST(this);
      __eval.notifyAboutSuspension(this);
     
      Accumulator target = null;
      if (__eval.__getAccumulators().empty()) {
        throw new UnguardedAppend(this);
      }
      if (!this.getDataTarget().isEmpty()) {
        String label = org.rascalmpl.interpreter.utils.Names.name(this
            .getDataTarget().getLabel());
        target = findDataTarget(__eval, label);
        if (target == null) {
          throw new UnguardedAppend(this); // TODO: better error
          // message
        }
      } else {
        target = __eval.__getAccumulators().peek();
      }
      Result<IValue> result = this.getStatement().interpret(__eval);
      target.append(result);
      return result;

    }
View Full Code Here

Examples of org.rascalmpl.interpreter.Accumulator

      if (!this.getLabel().isEmpty()) {
        label = org.rascalmpl.interpreter.utils.Names.name(this
            .getLabel().getName());
      }
      __eval.__getAccumulators().push(
          new Accumulator(__eval.__getVf(), label));
      IValue value = null;
      try {
        while (true) {
          try {
            try {
View Full Code Here

Examples of org.rascalmpl.interpreter.Accumulator

      if (!this.getLabel().isEmpty()) {
        label = org.rascalmpl.interpreter.utils.Names.name(this
            .getLabel().getName());
      }
      __eval.__getAccumulators().push(
          new Accumulator(__eval.__getVf(), label));

      // TODO: does this prohibit that the body influences the behavior
      // of the generators??

      int i = 0;
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.