bug-gnucobol
[Top][All Lists]
Advanced

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

RE: [open-cobol-list] minor preprocessor bug


From: William M. Klein
Subject: RE: [open-cobol-list] minor preprocessor bug
Date: Mon Feb 2 19:20:15 2004

There is a REAL problem here.  Neither the ANSI Standard *nor* any IBM
compiler supports "partial word replacement"  where a PART of a text word is
"replaced" by COPY REPLACING.

It is TRUE that you can use things like 

  Replacing ==(part-of-word)== by ==New-Part)

to change something like

   This-is-a(part-of-word)

but you MUST use specific characters "(" ":" or ")" to do this.  That is
because they define text words.

NEITHER the first nor the second "XX" should be replaced in this example
(and NEITHER would be replaced on IBM mainframe compilers) - and that
wouldbe true whether or NOT there was a "space" in pseudo-text-1.

NOTE:  ISO 2002 Standard *does* introduce "leading" and "trailing" options
for COPY/REPLACING, but it still wouldn't do a "replace" with this syntax. 

> -----Original Message-----
> From: address@hidden 
> [mailto:address@hidden On 
> Behalf Of David Korn
> Sent: Monday, February 02, 2004 8:07 PM
> To: address@hidden; address@hidden
> Subject: [open-cobol-list] minor preprocessor bug
> 
> cc:  address@hidden
> Subject: minor preprocessor bug
> --------
> 
> 
> =============prog2.cob===========================
>        COPY MYCOPY REPLACING = XX-= BY = LK-=.
> =============end prog2.cob===========================
> =============MYCOPY===========================
> 01 XX-ORIG-NPA-NXX-ZZ
> =============end MYCOPY===========================
> 
> cobc -static -std=mvs -E prog2.cob
> # 1 "prog2.cob"
> 
> # 1 "MYCOPY"
>        01 LK-ORIG-NPA-NLK-ZZ
> # 1 "prog2.cob"
> 
> 
> 
> Note that the space before the second XX but it is still 
> being replaced.
> It is behaving like
>        COPY MYCOPY REPLACING =XX-= BY =LK-=.
> 
> David Korn
> address@hidden
> 
> 
> -------------------------------------------------------
> The SF.Net email is sponsored by EclipseCon 2004
> Premiere Conference on Open Tools Development and Integration
> See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
> http://www.eclipsecon.org/osdn
> _______________________________________________
> open-cobol-list mailing list
> address@hidden
> https://lists.sourceforge.net/lists/listinfo/open-cobol-list
> 




reply via email to

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