gobo-eiffel / gobo

The Gobo Eiffel Project provides the Eiffel community with free and portable Eiffel tools and libraries.
https://sourceforge.net/projects/gobo-eiffel/
Other
59 stars 24 forks source link

Cannot successfully compile last example presented in the Gobo Eiffel Lex docs #35

Closed driivehard closed 5 years ago

driivehard commented 5 years ago

I get two valid errors

driivehard commented 5 years ago

Compilation error caused by feature scan_file The FILE and KI_CHARACTER_INPUT_STREAM classes are both deferred cannot create a_file

feature -- Scanning

scan_file
            -- Scan file whose name has been given as argument.
            -- Scan standard input if no argument has been given.
        local
            a_file: FILE
        do
            if argument_count >= 1 then
                create a_file.make_open_read (argument (1))
            else
                a_file := io.input
            end
            set_input_buffer (new_file_buffer (a_file))
            scan
        end
driivehard commented 5 years ago

This closed issue was helpful https://github.com/gobo-eiffel/gobo/issues/12#issuecomment-135989680 However, I still have problems running: scan How do I run the generated class on an input file?

jocelyn commented 5 years ago

FILE is indeed a deferred class. You can use either RAW_FILE or PLAIN_TEXTFILE from EiffelBase. And from Gobo, usually the KI are deferred classes, look at the KL_ .. for effective classes, for instance, in your case, KL_TEXT_INPUT_FILE (which is a descendant of PLAIN_TEXT_FILE).

jocelyn commented 5 years ago

I guess you are mentioning http://www.gobosoft.com/eiffel/gobo/gelex/examples.html indeed, I think the documentation is wrong, and maybe obsolete. You can contribute with a PR to the Gobo project, once you have this sample working.

driivehard commented 5 years ago

Yes, I was referring to the last example provided http://www.gobosoft.com/eiffel/gobo/gelex/examples.html

ebezault commented 5 years ago

While waiting for me to fix the documentation, you should note that there are working examples in $GOBO/library/lexical/example

driivehard commented 5 years ago

Thanks for the note, I am working with the examples

ebezault commented 5 years ago

The example is now fixed in the documentation.