0

I'm trying to build xplain2sql using Gobo compiler and its tools. After issuing geant compile command I get a lot of similar errors:

[CATCALL] class SQL_GENERATOR_TSQL65 (SQL_GENERATOR,2610,5): type 'STRING_8' of actual argument #1 does not conform to type 'UC_STRING' of formal argument in feature `is_equal' in class 'UC_STRING'

Above error refers to the last line of this code:

    sql_infix_expression (a_left: XPLAIN_EXPRESSION; an_operator: STRING; a_right: XPLAIN_EXPRESSION): STRING
        -- SQL expression for multiplication/division, etc.
    require
        valid_left: a_left /= Void
        valid_right: a_right /= Void
        operator_not_empty: an_operator /= Void and then not an_operator.is_empty
    local
        left_value,
        right_value: STRING
    do
        if
            an_operator.is_equal (once "+") and then

I don't know Eiffel, I just want to compile this code. There were other build errors which I was able to fix using some common sense and experience from other programming languages but I don't know how to deal with this.

Grzegorz Adam Kowalski
  • 5,243
  • 3
  • 29
  • 40

2 Answers2

1

In this case, I think you could use same_string (..) as replacement for is_equal (..) .

Jocelyn
  • 693
  • 5
  • 8
  • This worked for some errors but not all . Some of them point to the body of `equal (..)` (in standard library) which invokes `is_equal (..)`. Is there a strings-only replacement for `equal (..)` just like there was for `is_equal (..)`? I'm trying to find it in documentation but without any luck. – Grzegorz Adam Kowalski Oct 31 '17 at 21:19
  • I've had some success with changing some `equal (..)` calls to `is_equal(..)` to check if error messages are generated by these particular lines or code and then modifying them to use `same_string (..)`. This is tedious work but it seems to work. – Grzegorz Adam Kowalski Oct 31 '17 at 21:53
  • Maybe you'd like to further help me in this question: https://stackoverflow.com/questions/47045431/getting-stack-trace-from-geant – Grzegorz Adam Kowalski Oct 31 '17 at 22:29
  • The issue is related to a redefinition of `is_equal` in `UC_STRING` that takes an argument of type `like Current`, i.e. `UC_STRING`. Changing `is_equal` to `same_string` works in this particular case because `same_string` takes `STRING_8` as an argument. This does not solve the general issue reported for the class `ANY` because `same_string` cannot be used there. – Alexander Kogtenkov Nov 01 '17 at 05:25
0

There is a option in the Gobo compiler that turns CAT-call errors into warnings, but it did not help me to complete the build successfully. However, the project compiles fine with EiffelStudio:

ec -config xplain2sql.ecf -c_compile -finalize

The resulting executable can be found in EIFGENs\xplain2sql\F_code.

Alexander Kogtenkov
  • 5,770
  • 1
  • 27
  • 35