Examples of arrayDescriptor()


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


  private ExpressionNode rewriteArrayLookup( ExpressionNodeForFunction _fun )
  {
    final ExpressionNodeForArrayReference array = (ExpressionNodeForArrayReference) _fun.argument( 1 );
    final ArrayDescriptor desc = array.arrayDescriptor();
    final int cols = desc.numberOfColumns();
    final int rows = desc.numberOfRows();
    final Function lookupFun;
    final int index;
    if (cols > rows) {
View Full Code Here

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

      final String matchRefName = "x";
      final ExpressionNode matchRefNode = var( matchRefName );
      final ExpressionNode selectorNode = indexNode;
      final ExpressionNode defaultNode = err( "#VALUE/REF! because index is out of range in H/VLOOKUP" );

      final ArrayDescriptor desc = arrayNode.arrayDescriptor();
      final int nArrays = (fun == HLOOKUP) ? desc.numberOfRows() : desc.numberOfColumns();
      final ExpressionNodeForSwitchCase[] caseNodes = new ExpressionNodeForSwitchCase[ nArrays ];
      for (int iArray = 0; iArray < nArrays; iArray++) {
        final ExpressionNode valueArrayNode = getHVLookupSubArray( fun, arrayNode, iArray );
        final ExpressionNode lookupNode = fun( INDEX, valueArrayNode, matchRefNode );
View Full Code Here

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

  protected final Object[] asArrayOfConsts( Object _value )
  {
    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;
View Full Code Here

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

  {
    final Iterator<ExpressionNode> iElt = _tableElements.iterator();
    final ExpressionNode first = iElt.next();
    if (first instanceof ExpressionNodeForArrayReference) {
      final ExpressionNodeForArrayReference firstArr = (ExpressionNodeForArrayReference) first;
      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() );
View Full Code Here

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

  private final void compileIndex( ExpressionNodeForFunction _node ) throws CompilerException
  {
    final ExpressionNodeForArrayReference array = (ExpressionNodeForArrayReference) _node.argument( 0 );
    switch (_node.cardinality()) {
      case 2:
        if (array.arrayDescriptor().numberOfColumns() == 1) {
          compileIndex( array, _node.argument( 1 ), null );
        }
        else if (array.arrayDescriptor().numberOfRows() == 1) {
          compileIndex( array, null, _node.argument( 1 ) );
        }
View Full Code Here

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

    switch (_node.cardinality()) {
      case 2:
        if (array.arrayDescriptor().numberOfColumns() == 1) {
          compileIndex( array, _node.argument( 1 ), null );
        }
        else if (array.arrayDescriptor().numberOfRows() == 1) {
          compileIndex( array, null, _node.argument( 1 ) );
        }
        else {
          throw new CompilerException.UnsupportedExpression(
              "INDEX with single index expression must not have two-dimensional range argument." );
View Full Code Here

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

  protected final void compileArray( ExpressionNode _arrayNode ) throws CompilerException
  {
    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++ );
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.