Package org.formulacompiler.compiler.internal.expressions

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


      }
      else if (cst instanceof String) {
        return buildFilterByExample( _tableCol, (String) cst, _type );
      }
      else {
        final ExpressionNode critExpr = expressionOf( _criterion );
        if (critExpr instanceof ExpressionNodeForOperator) {
          ExpressionNodeForOperator op = (ExpressionNodeForOperator) critExpr;
          switch (op.getOperator()) {
            case CONCAT: {
              final Object cst0 = constantValueOf( op.argument( 0 ) );
View Full Code Here



    private ExpressionNode buildFreeFormFilter( ExpressionNode _criterion, List<CellModel> _firstRow )
        throws CompilerException
    {
      final ExpressionNode critExpr = expressionOf( _criterion );
      return replaceTableCellsByColRefs( critExpr, _firstRow );
    }
View Full Code Here

        else {
          return _node;
        }
      }
      else {
        final ExpressionNode clone = _node.cloneWithoutArguments();
        for (ExpressionNode arg : _node.arguments()) {
          clone.addArgument( replaceTableCellsByColRefs( arg, _firstRow ) );
        }
        return clone;
      }
    }
View Full Code Here

  private WritableCell createCell( CellInstance _c, WritableWorkbook _xwb, int _col, int _row )
      throws SpreadsheetException
  {
    if (_c instanceof CellWithExpression) {
      final ExpressionNode expr = ((CellWithExpression) _c).getExpression();
      return new Formula( _col, _row, this.formatter.format( expr ) );
    }
    else {
      final Object val = _c.getValue();
      if (val instanceof String) {
View Full Code Here

      final Object cst = _cell.getConstantValue();
      if (null != cst) {
        _cell.setDataType( typeOfConstant( cst ) );
      }
      else {
        final ExpressionNode expr = _cell.getExpression();
        if (null != expr) {
          _cell.setDataType( annotate( expr ) );
        }
        else {
          _cell.setDataType( DataType.NULL );
View Full Code Here

    switch (_expr.getFunction()) {
      // ...
      // ---- typeOfFun

      case IF:
        final ExpressionNode thenArg = _expr.argumentOrNull( 1 );
        if (null != thenArg) {
          final ExpressionNode elseArg = _expr.argumentOrNull( 2 );
          if (null != elseArg) {
            return commonTypeOf( _expr, thenArg, elseArg );
          }
          else {
            return commonTypeOf( _expr, thenArg );
View Full Code Here

    return typeOf( _expr.arguments() );
  }

  private DataType typeOf( final ExpressionNodeForLogging _expr ) throws CompilerException
  {
    final ExpressionNode exp = _expr.argument( 0 );
    return annotate( exp );
  }
View Full Code Here

  }

  private DataType commonTypeOf( ExpressionNode _parent, ExpressionNode... _args ) throws CompilerException
  {
    DataType refType = null;
    ExpressionNode refExpr = null;
    for (ExpressionNode arg : _args) {
      final DataType type = arg.getDataType();
      if (type != null) {
        refType = type;
        refExpr = arg;
View Full Code Here

  @Override
  protected boolean visitCell( CellModel _cell ) throws CompilerException
  {
    assert _cell.getDataType() != null;
    final ExpressionNode expr = _cell.getExpression();
    if (null != expr) visitExpr( expr );
    return true;
  }
View Full Code Here

      try {
        return visitCell( _cell );
      }
      catch (InnerExpressionException e) {
        final CompilerException cause = e.getCause();
        final ExpressionNode errorNode = e.getErrorNode();
        if (null != errorNode) {
          cause.addMessageContext( errorNode.getContext( errorNode ) );
        }
        else {
          final ExpressionNode cellExpr = _cell.getExpression();
          if (null != cellExpr) {
            cause.addMessageContext( cellExpr.getContext( null ) );
          }
          else {
            cause.addMessageContext( "\nCell containing expression is " + _cell.getFullName() + "." );
          }
        }
View Full Code Here

TOP

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

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.