Package org.formulacompiler.compiler.internal.expressions

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


    boolean rewritten = false;
    for (int iArg = 1; iArg <= 2 && iArg < _fun.cardinality(); iArg++) {
      final ExpressionNode arg = _fun.argument( iArg );
      if (arg instanceof ExpressionNodeForFunction && ((ExpressionNodeForFunction) arg).getFunction() == MATCH) {
        final ExpressionNode newArg = fun( INTERNAL_MATCH_INT );
        newArg.arguments().addAll( arg.arguments() );
        newArgs.set( iArg, newArg );
        rewritten = true;
      }
    }
    if (rewritten) {
View Full Code Here


        rewritten = true;
      }
    }
    if (rewritten) {
      final ExpressionNode newFun = _fun.cloneWithoutArguments();
      newFun.arguments().addAll( newArgs );
      return newFun;
    }
    return _fun;
  }
View Full Code Here

        dynArgs.add( (ExpressionNode) arg );
      }
    }
    if (dynArgs.size() > 0) {
      final ExpressionNode result = node().cloneWithoutArguments();
      result.arguments().addAll( dynArgs );
      return result;
    }
    else {
      return ConstResult.valueOf( !_returnThisIfFound );
    }
View Full Code Here

  private void convertRangesToCells( final ExpressionNodeSource _nodeSource, final boolean _allowRanges )
  {
    final ExpressionNode node = _nodeSource.getExpressionNode();
    if (node instanceof ExpressionNodeForOperator) {
      final ListIterator<ExpressionNode> nodeListIterator = node.arguments().listIterator();
      while (nodeListIterator.hasNext()) {
        final ExpressionNode argNode = nodeListIterator.next();
        convertRangesToCells( new ExpressionNodeSource()
        {
          public ExpressionNode getExpressionNode()
View Full Code Here

    else {
      final ExpressionNode result = _exprDef.cloneWithoutArguments();
      for (ExpressionNode arg : _exprDef.arguments()) {
        final ExpressionNode argResult = buildExpressionModel( arg );
        if (argResult instanceof ExpressionNodeForSubstitution) {
          result.arguments().addAll( argResult.arguments() );
        }
        else {
          result.addArgument( argResult );
        }
      }
View Full Code Here

          .build();
      if (shaped) {
        return path.wrapAround( outer );
      }
      else {
        return path.wrapAround( outer.arguments() );
      }
    }

    private ExpressionNode buildContainedRange() throws CompilerException
    {
View Full Code Here

      final CellIndex from = range.getFrom();
      final ExpressionNode result = (shaped) ? new ExpressionNodeForArrayReference( new ArrayDescriptor(
          from.getSheetIndex(), from.getRowIndex(), from.getColumnIndex(), sheets, rows, cols ) )
          : new ExpressionNodeForSubstitution();
      result.arguments().addAll( elts );
      return result;
    }

    private ExpressionNode buildExpressionModelForInnerRange( SectionBinding _inner, CellRange _range )
        throws CompilerException
View Full Code Here

          .buildContainedRange();
      if (shaped) {
        return path.wrapAround( expr );
      }
      else {
        return path.wrapAround( expr.arguments() );
      }
    }

    private ExpressionNode buildExpressionModelForLocalRange( CellRange _range ) throws CompilerException
    {
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

  private List<String> getLabelsFromTable( ArrayDescriptor _tableDesc, List<ExpressionNode> _tableElements )
      throws CompilerException
  {
    final ExpressionNode first = _tableElements.get( 0 );
    if (first instanceof ExpressionNodeForArrayReference) {
      return getLabelsFromTable( _tableDesc, first.arguments() );
    }
    else {
      final int nCol = _tableDesc.numberOfColumns();
      final List<String> result = New.list( nCol );
      final Iterator<ExpressionNode> iElt = _tableElements.iterator();
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.