Closed driivehard closed 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
This closed issue was helpful
https://github.com/gobo-eiffel/gobo/issues/12#issuecomment-135989680
However, I still have problems running:
scan
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).
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.
Yes, I was referring to the last example provided http://www.gobosoft.com/eiffel/gobo/gelex/examples.html
While waiting for me to fix the documentation, you should note that there are working examples in $GOBO/library/lexical/example
Thanks for the note, I am working with the examples
The example is now fixed in the documentation.
I get two valid errors