Package org.formulacompiler.compiler.internal.expressions

Examples of org.formulacompiler.compiler.internal.expressions.ExpressionNodeForArrayReference.arguments()


      throw new FormulaException( "#VALUE! because range is empty in MATCH" );
    }
    final ExpressionNodeForArrayReference range = (ExpressionNodeForArrayReference) _in;
    if (0 == _type) {
      int iObj = 0;
      for (Object arg : range.arguments()) {
        final Object elt = ((ExpressionNodeForConstantValue) arg).value();
        if (_lookup.equals( elt )) return iObj;
        iObj++;
      }
      throw new NotAvailableException();
View Full Code Here


      throw new NotAvailableException();
    }
    else {
      final Comparable comp = (Comparable) _lookup;
      final int isToRightWhenComparesAs = (_type > 0) ? 1 : -1;
      final List<ExpressionNode> args = range.arguments();
      final int iLast = args.size() - 1;
      int iLeft = 0;
      int iRight = iLast;
      while (iLeft < iRight) {
        final int iMid = iLeft + ((iRight - iLeft) >> 1);
View Full Code Here

  {
    if (_value instanceof ExpressionNodeForArrayReference) {
      final ExpressionNodeForArrayReference array = (ExpressionNodeForArrayReference) _value;
      final Object[] r = new Object[ array.arrayDescriptor().numberOfElements() ];
      int i = 0;
      for (ExpressionNode cst : array.arguments()) {
        r[ i++ ] = ((ExpressionNodeForConstantValue) cst).value();
      }
      return r;
    }
    else {
View Full Code Here

      final int sheets = to.getSheetIndex() - from.getSheetIndex() + 1;
      final int rows = to.getRowIndex() - from.getRowIndex() + 1;
      final int cols = to.getColumnIndex() - from.getColumnIndex() + 1;
      final ExpressionNode result = new ExpressionNodeForArrayReference( new ArrayDescriptor( from.getSheetIndex(),
          from.getRowIndex(), from.getColumnIndex(), sheets, rows, cols ) );
      buildExpressionModelsForLocalRangeCells( _range, result.arguments() );
      return result;
    }

    private void buildExpressionModelsForLocalRangeCells( CellRange _range, Collection<ExpressionNode> _elts )
        throws CompilerException
View Full Code Here

    else {
      assert desc.numberOfRows() == 1;
      final ArrayDescriptor newDesc = new ArrayDescriptor( desc.origin(), new ArrayDescriptor.Point( 1, desc
          .numberOfColumns(), 1 ) );
      final ExpressionNodeForArrayReference newVector = new ExpressionNodeForArrayReference( newDesc );
      newVector.arguments().addAll( _vector.arguments() );
      return newVector;
    }
  }

View Full Code Here

      final ArrayDescriptor firstArrDesc = firstArr.arrayDescriptor();
      final int firstArrRows = firstArrDesc.numberOfRows();
      if (firstArrRows > 1) {
        final ExpressionNodeForArrayReference newFirstArr = new ExpressionNodeForArrayReference(
            new ArrayDescriptor( firstArrDesc, +0, 0, -1, 0 ) );
        stripLabelsFromTableInto( firstArrDesc, firstArr.arguments(), newFirstArr.arguments() );
        _result.add( newFirstArr );
      }
    }
    else {
      final int nCol = _tableDesc.numberOfColumns();
View Full Code Here

  private ExpressionNodeForArrayReference getShapedDataFromTable( ArrayDescriptor _tableDesc,
      List<ExpressionNode> _tableElements )
  {
    final ArrayDescriptor dd = new ArrayDescriptor( _tableDesc, +1, 0, -1, 0 );
    final ExpressionNodeForArrayReference result = new ExpressionNodeForArrayReference( dd );
    result.arguments().addAll( _tableElements );
    return result;
  }

  private int[] getFoldableColumnKeys( DataType[] _colTypes )
  {
View Full Code Here

    final ExpressionNodeForArrayReference arrayNode = this.node;
    final ExpressionCompiler valCompiler = expressionCompiler( arrayNode.getDataType() );
    final int valReturn = valCompiler.typeCompiler().returnOpcode();
    final GeneratorAdapter mv = mv();

    final List<ExpressionNode> vals = arrayNode.arguments();
    final int valCnt = vals.size();
    if (valCnt > 0) {
      mv.visitVarInsn( Opcodes.ILOAD, 1 ); // index

      // gen switch
View Full Code Here

    final GeneratorAdapter mv = mv();
    final ExpressionNodeForArrayReference arr = (ExpressionNodeForArrayReference) _arrayNode;
    mv.push( arr.arrayDescriptor().numberOfElements() );
    compileNewArray();
    int i = 0;
    for (ExpressionNode arg : arr.arguments()) {
      mv.visitInsn( Opcodes.DUP );
      mv.push( i++ );
      compile( arg );
      mv.visitInsn( arrayStoreOpcode() );
    }
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.