/** Compiles ValueExpressions */
  @Override
  public void visit(ValueExpression expression) {
    if (expression == null) {
      throw new ArgumentException(EXPRESSION + E_IS_NULL);
    }

    // FIXME: Treat all numerics as BigDecimal or better yet, MutableDecimal
    // Also - what other types must we handle?
    // BYTE? BYTEARRAY? CHARACTER?
    switch (expression.getType()) {
      case BOOLEAN:
        result.setResult(
            new Literal<Boolean>(ValueType.BOOLEAN, Boolean.parseBoolean(expression.getText())));
        break;

      case DATETIME:
        result.setResult(
            new Literal<DateTime>(
                ValueType.DATETIME,
                // DateTime.parse(expression.getText().substring(1,
                // expression.getText().length() - 2))));
                DateTime.parse(expression.getText())));
        break;
      case INTEGER:
      case DECIMAL:
        result.setResult(
            new Literal<Double>(ValueType.DECIMAL, Convert.parseNumeric(expression.getText())));
        break;

      case TEXT:
        result.setResult(new Literal<String>(ValueType.TEXT, expression.getText()));
        break;

      case VARIABLE:
        Variable var = new Variable(expression.getText());
        // Record for easy update before compute
        result.addOrUpdateVariable(var);
        result.setResult(var);
        break;
    }
  }