Package org.formulacompiler.compiler.internal.expressions

Examples of org.formulacompiler.compiler.internal.expressions.ExpressionNodeForFoldDefinition


  private static final String[] NO_NAMES = new String[ 0 ];
  private static final ExpressionNode[] NO_EXPRS = new ExpressionNode[ 0 ];

  private ExpressionNode fold_count()
  {
    return new ExpressionNodeForFoldDefinition( NO_NAMES, NO_EXPRS, null, New.array( "xi" ), NO_EXPRS, "n",
        var( "n" ), ZERO, true, true );
  }
View Full Code Here


  }


  private TypedResult partialFold( TypedResult[] _initials, boolean _initialsChanged )
  {
    final ExpressionNodeForFoldDefinition newFold;
    if (_initialsChanged || fold.isCounted()) {
      final Iterator<ExpressionNode> foldArgs = fold.arguments().iterator();
      newFold = fold.cloneWithoutArgumentsAndForbidReduce();
      newFold.setPartiallyFoldedElementCount( partialStepCount );
      for (int i = 0; i < _initials.length; i++) {
        newFold.addArgument( valueToNode( _initials[ i ] ) );
        foldArgs.next();
      }
      while (foldArgs.hasNext())
        newFold.addArgument( foldArgs.next() );
    }
    else {
      newFold = fold;
    }
View Full Code Here

      addToClosure( _closure, let.value() );
      addToClosureWithInnerDefs( _closure, let.in(), let.varName() );
    }

    else if (_node instanceof ExpressionNodeForFoldDefinition) {
      final ExpressionNodeForFoldDefinition fold = (ExpressionNodeForFoldDefinition) _node;

      for (int i = 0; i < fold.accuCount(); i++)
        addToClosure( _closure, fold.accuInit( i ) );

      for (int i = 0; i < fold.accuCount(); i++)
        letInnerDef( fold.accuName( i ) );
      for (int i = 0; i < fold.eltCount(); i++)
        letInnerDef( fold.eltName( i ) );
      letInnerDef( fold.indexName() );

      for (int i = 0; i < fold.accuCount(); i++)
        addToClosure( _closure, fold.accuStep( i ) );

      unletInnerDef( fold.indexName() );
      letDict().unlet( fold.eltCount() );
      letInnerDef( fold.countName() );

      addToClosure( _closure, fold.merge() );

      unletInnerDef( fold.countName() );
      letDict().unlet( fold.accuCount() );

      addToClosure( _closure, fold.whenEmpty() );
    }

    else {
      addToClosure( _closure, _node.arguments() );
    }
View Full Code Here

TOP

Related Classes of org.formulacompiler.compiler.internal.expressions.ExpressionNodeForFoldDefinition

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.