Package org.formulacompiler.compiler.internal.expressions

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



  private ExpressionNode rewriteFun( ExpressionNodeForFunction _fun, boolean[] _haveRewritten )
      throws CompilerException
  {
    ExpressionNodeForFunction curr = _fun;
    ExpressionNode rewritten = rewriteFunOnce( curr );
    while (rewritten != curr && rewritten instanceof ExpressionNodeForFunction) {
      curr = (ExpressionNodeForFunction) rewritten;
      rewritten = rewriteFunOnce( curr );
    }
View Full Code Here


    final ExpressionNode matchNode;
    final Function matchFun = (indexNode instanceof ExpressionNodeForConstantValue) ? INTERNAL_MATCH_INT : MATCH;
    if (_fun.cardinality() >= 4) {
      final ExpressionNode typeNode = _fun.argument( 3 );
      matchNode = new ExpressionNodeForFunction( matchFun, valueNode, lookupArrayNode, typeNode );
    }
    else {
      matchNode = new ExpressionNodeForFunction( matchFun, valueNode, lookupArrayNode );
    }

    if (indexNode instanceof ExpressionNodeForConstantValue) {
      final ExpressionNodeForConstantValue constIndex = (ExpressionNodeForConstantValue) indexNode;
      final int index = this.numericType.toInt( constIndex.value(), -1 ) - 1;
View Full Code Here

    /*
     * Invalid values assume a numeric data type. This will lead to errors if they occur in string
     * expressions. We cannot handle these yet.
     */
    if (CellWithError.NA.equals( _cell.getValue() )) {
      _cellModel.setExpression( new ExpressionNodeForFunction( Function.NA ) );
    }
    else {
      _cellModel.setExpression( err( _cell.getError(), DataType.NUMERIC ) );
    }
  }
View Full Code Here

    return new ExprNodeImpl( new ExpressionNodeForOperator( _op, nodesOf( _args ) ) );
  }

  public ExprNode fun( Function _fun, ExprNode... _args )
  {
    return new ExprNodeImpl( new ExpressionNodeForFunction( _fun, nodesOf( _args ) ) );
  }
View Full Code Here

    {
      if (_nodes.size() == 1) {
        return _nodes.iterator().next();
      }
      else {
        return new ExpressionNodeForFunction( _joinBy, _nodes );
      }
    }
View Full Code Here

            return;
        }
      }

      else if (this.node instanceof ExpressionNodeForFunction) {
        final ExpressionNodeForFunction fnNode = (ExpressionNodeForFunction) this.node;
        final Function fn = fnNode.getFunction();

        switch (fn) {

          case AND:
            compileAnd();
View Full Code Here

        compileOperator( node );
      }
    }

    else if (_node instanceof ExpressionNodeForFunction) {
      final ExpressionNodeForFunction node = (ExpressionNodeForFunction) _node;
      switch (node.getFunction()) {

        case IF:
          compileIf( node );
          break;
View Full Code Here

TOP

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

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.