Feature #3178
implement STREAM-HANDLE support
0%
History
#1 Updated by Igor Skornyakov over 7 years ago
- File stream-handle.p added
- The conversion of the attached program (which runs on 4GL) fails with the
## No accessors generated for STATEMENT/KW_DISP/KW_STRM_HND (stream-handle)
- if we comment
display stream-handle ...
statement then the conversion doesn't compile as there are nodown(handle)
andUnnamedStreams.closeOut(handle)
methods in the corresponding interfaces/classes. - if we comment the corresponding statements then the application fails at run time at
h.assign(rptStream);
withjava.lang.IllegalArgumentException: Invalid value type.
exception
#2 Updated by Greg Shah about 5 years ago
- Start date deleted (
09/02/2016) - Assignee set to Constantin Asofiei
- Subject changed from STREAM-HANDLE support issues to implement STREAM-HANDLE support
- Project changed from Bugs to Base Language
- Tracker changed from Bug to Feature
The original problem report is expected behavior because FWD does not yet have STREAM-HANDLE
support. This task is meant to create that support.
#3 Updated by Greg Shah over 4 years ago
Constantin: I know you provided some early support for this, but my impression was that it was not complete. Would you please post a summary of what was implemented (including 4GL + converted Java for the conversion part)? Then make a list of what work remains.
#4 Updated by Constantin Asofiei over 4 years ago
The support in FWD was added for PUT, IMPORT, EXPORT, OUTPUT TO, INPUT FROM statements.
Any frame-related statements (like DISPLAY, UPDATE, etc) are not implemented to work with STREAM-HANDLE.
The solution was to 'hijack' the reference name and emit it as hStream.unwrapStream()
, if STREAM-HANDLE
is used - see get_stream_accessor
in convert/input_output.rules
. get_stream_accessor
covers static stream access, too.
A more generic solution (to include the frame-related statements) was not easy to find, as the stream reference is emitted throughout the FWD conversion rules, and not in a single point.
For example, this code:
put stream-handle h unformatted "v".
will emit as:
hStream.unwrapStream().putUnformatted(new FieldEntry[] { new PutField("v") });
#5 Updated by Greg Shah over 4 years ago
As far as I can see, we have to review each location where kw_stream
(case-insensitive) is being used in TRPL and for each one we must add processing for kw_strm_hnd
. There are only 34 locations and some of them have already got support from your changes.
Is there anything else you can think of?
#6 Updated by Greg Shah over 4 years ago
In 4069a, I'm changing the gap marking to partial for conversion and full for runtime. Is that OK?
#7 Updated by Constantin Asofiei over 4 years ago
Greg Shah wrote:
In 4069a, I'm changing the gap marking to partial for conversion and full for runtime. Is that OK?
Yes.