Re: [Cobolforgcc-devel] MOVE subroutine in UNSTRING
Status: Pre-Alpha
Brought to you by:
timjosling
From: Tim J. <te...@me...> - 2001-04-10 20:52:37
|
Steven, How about this: - add a parameter for each receiving area, to specify the type per cobr_type enum in cobr_temp_config.h. - add a parameter for each receiving area to say if it is left justified or right justified (eg a COB_UINT32 which has value 1 if right justified - hand code to cater only for the type cobrTypeText which is pic x(n) and also cater for right justified. - add assert(type_parm==cobrTypeText); so that it will crash if someone passes something it can't handle. Or some other scheme, as long as it is simple and uses the types in cobr_temp_config.h Later on once all the move variants are supported we can add code to call the appropriate routine. Regards, Tim Josling "Steven O. Ellis" wrote: > > Tim, > > STRING is OK. The following rule disallows a right-justified receiving > item. Identifier-3 is the receiving item. > > 6.25.3 Syntax rules > > 4) Identifier-3 must not represent an edited data item and must > not be described with the JUSTIFIED clause. > > However, for UNSTRING, the receiving area may be numeric. UNSTRING > General Rule 6.27.3 (2) refers to the sending area, not the receiving > area. I do believe there is the potential for a numeric move per > General Rule 6.27.4 (13c), quoted below. And per MOVE General Rule > 6.19.4 (4b), when the receiving area is numeric and the sending area is > alphanumeric, "data is moved as if the sending operand were described as > an unsigned numeric integer." > > This is not something that needs to be resolved at once, but I am > thinking that the final version of UNSTRING is going to have to be able > to handle a more sophisticated move. > > Steven > > Tim Josling wrote: > > > > Steven, > > > > I have written the move code but I am not supporting right > > justified at present. The alpha moves are being done by directly > > generated code in the compiler rather than by runtime routines so > > fortunately there is no module I will be able to send you for > > that. The runtime routines I have written (and tested yesterday) > > are all to do with num->X and x->num. > > > > I suggest that you add a flag for left/right justified to the > > receiving area description for alphanumeric fields. > > > > In 6.27.3 (2) states that the receiving areas have to be > > alphanumeric (fortunately), so the numeric issue should not > > arise. > > > > By the way the same problem would arise with cobr_string.c as > > well - support for right justified. I will add a bug report so I > > don't forget it. > > > > Tim Josling > > > > "Steven O. Ellis" wrote: > > > > > > Tim, > > > > > > The UNSTRING statement, conceptually at least, has an embedded MOVE in > > > it. I understand from recent messages on the mailing list that you are > > > working on MOVE. Please let me know when you have a first draft, so > > > that I may "borrow" from it when coding UNSTRING. Meanwhile, I will > > > work on test cases, and rest of the prototype. Here is the relevant > > > clause from the 1985 Standard, referring to a subset of characters from > > > the source area to be moved to one of the receiving areas. > > > > > > 6.27.4 General Rules > > > > > > (13) c. The characters thus examined (excluding the delimiting > > > character(s), if any) are treated as an elementary alphanumeric > > > data item, and are moved into the current receiving area > > > according to the rules for the MOVE statement. (See page VI-103, > > > The MOVE Statement.) > > > > > > This becomes nontrivial when you consider that the receiving area may be > > > defined as signed numeric or alphanumeric right-justified. > > > > > > Steven > > > > > > _______________________________________________ > > > Cobolforgcc-devel mailing list > > > Cob...@li... > > > http://lists.sourceforge.net/lists/listinfo/cobolforgcc-devel > > > > _______________________________________________ > > Cobolforgcc-devel mailing list > > Cob...@li... > > http://lists.sourceforge.net/lists/listinfo/cobolforgcc-devel > > -- > \/\/\/\/\/\/\/\/\/\/\/\/ > > _______________________________________________ > Cobolforgcc-devel mailing list > Cob...@li... > http://lists.sourceforge.net/lists/listinfo/cobolforgcc-devel |