gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [open-cobol-list] Re. Small Cobol changes for MVS compatibility


From: Roger While
Subject: RE: [open-cobol-list] Re. Small Cobol changes for MVS compatibility
Date: Tue Nov 16 01:36:56 2004

Hi Bill,
Agreed, however, I was trying to make clear the position as
regards the trailing space in the pseudo-text which IS unambiguous.
(At least to my interpretation) (Ans is fully clear with respect to the example
 from Mr. Korn)

Interesting, quoting the paragraph GR10(a) fully -
"The leftmost library text-word that is not a separator comma or a separator semicolon is the first text-word used for comparison. Any text-word or space preceding this text-word is copied into the resultant text. Starting with the first text-word for comparison and first pseudo-text-1, text-1, word-1, literal-3, or partial-word-1 that was specified in the REPLACING phrase, the entire REPLACING phrase operand that precedes the reserved word BY is compared to an equivalent number of contiguous library text-words."

In particular, the second sentence. What can be "preceding" when the first sentence talks about
"leftmost" ?

Roger

At 16:24 15.11.2004 -0600, you wrote:
Roger,
You couldn't be MORE mistaken about what the '02 Standard says (and this
IS consistent with the '85 Standard) when you say,

"If you say ==<space>TEXT<space>== BY
> ==<space>TEXT2<space>== , then 2002 states that
> this is EXACTLY what will be searched for"

See: GR10(a) on page 34 which states, (in part),

"The leftmost library text-word that is not a separator comma or a separator
semicolon is the first text-word used for comparison."

In other words,

   ==text-word==

DOES match

  ==, . text-word==

and also matches

  ==<space>text-word==

(all spaces and non-spaces and equivalent separators) are treated as
IRRELEVANT before the first text-word.

It *is* true that the '85 Standard (and the '02) Standard BOTH state that
when a match is found, that you MUST put all of pseudo-text-2 (the stuff
after the BY) into the resulting text.

This is why I indicated that *if* the current implementation is NOT placing
spaces in the resulting text (when they appear in pseudo-text-2) that is
NON-conforming.

> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On
> Behalf Of Roger While
> Sent: Monday, November 15, 2004 2:59 PM
> To: address@hidden
> Subject: [open-cobol-list] Re. Small Cobol changes for MVS
> compatibility
>
> David, I'm fairly OK with 1 and 2.
> But definitely not with 3.
> I was always mystified by the way compilers jumped through
> hoops to supposedly adhere to the nonsense 85 standard.
> In the 2002 standard, things are absolutely clear.
> If you say ==<space>TEXT<space>== BY
> ==<space>TEXT2<space>== , then 2002 states that
> this is EXACTLY what will be searched for and EXACTLY what
> will be replaced.
> The only extra processing is :
> "Each occurrence of a separator comma, semicolon, or space in
> pseudo-text-1
> or in the library text is
> considered to be a single space. Each sequence of one or more space
> separators is considered to be
> a single space."
>
> In fact, because of the 85 confusion, MicroFocus says this :
> "(ANS85) If certain conventions are followed in library text,
> parts of
> names, for example the prefix portion of data-names, can be
> changed with
> the REPLACING phrase. To use this type of "partial word
> replacement" the
> portion of the words to be modified must be enclosed in one of the
> following ways:
> In pairs of left and right parentheses. For example, (ABC)
> Within colons. For example :XYZ: "
>
> So, regardless of what Open Cobol does or does not do, I would change
> your copy statements to be unambiguous. In my opinion,
> putting spaces at
> the end of
> pseudo-text and expecting the compiler to know what you mean
> is asking for
> trouble.
> Take out the trailing space at the end of pseudo-text-1 and
> -2, and then
> you have a prog that
> should compile with any standard (theoretically) .
>
> Roger




reply via email to

[Prev in Thread] Current Thread [Next in Thread]