Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

C-preprocessor for COBOL?
2004-07-05 12:00:00 MEST

This is not supposed to be a joke.

The C-preprocessor which can be used quite
independent of C, at least in the Unix-Environment,
can be used for other languages than C - it can
even be used for poetry and such.

Now, in the old days, when COBOL did not have
conditional compilation, you could, for instance,
"misuse" the C-preprocessor to have conditional
compilation. Also, at least some of the other
capabilities of the C-preprocessor could also be
used, if one dares to do so.

Does anyone know, whether there are/were serious
projects where this was regulary done?

Herwig



Report this thread to moderator Post Follow-up to this message
Old Post
Herwig Huener
07-05-04 01:55 PM


Re: C-preprocessor for COBOL?
Herwig Huener wrote:
> 2004-07-05 12:00:00 MEST
>
> This is not supposed to be a joke.
>
> The C-preprocessor which can be used quite
> independent of C, at least in the Unix-Environment,
> can be used for other languages than C - it can
> even be used for poetry and such.
>
> Now, in the old days, when COBOL did not have
> conditional compilation, you could, for instance,
> "misuse" the C-preprocessor to have conditional
> compilation. Also, at least some of the other
> capabilities of the C-preprocessor could also be
> used, if one dares to do so.
>
> Does anyone know, whether there are/were serious
> projects where this was regulary done?
>
> Herwig
>
>
Herwig,

I would contact the Tiny COBOL project. Their
'85 compiler is built on C, and they have
first hand experiences that  might help.

Warren Simmons

Report this thread to moderator Post Follow-up to this message
Old Post
Warren Simmons
07-05-04 08:55 PM


Re: C-preprocessor for COBOL?
2004-07-05 21:01:20 MEST

Warren Simmons wrote:

> ...
>
> I would contact the Tiny COBOL project. Their
> '85 compiler is built on C, and they have
> first hand experiences that  might help.

That is not quite what I had in my mind.

Of course a COBOL-compiler may generate C rather than
some machine code, and it may be possible to translate
some of the COBOL-directives of the new COBOL standard into
C-preprocessor commands - we never did an investigation
on this idea, maybe there are difficulties which are
not easily overcome - but what I am thinking about
is this kind of language-mixture:

#define BLUBH

#ifdef BLUBH
display "Mixed language conditional compilation!"
upon tv.
#else
this is never compiled ...
#endif

This requires a C-Preprocessor and then a COBOL-compiler.

Actually you are right on one thing: It is ages ago
that I looked the last time on the pages of the Tiny
COBOL Project - so they still exist? I had the impression
that some of the team members lost interest on
that project, and so, then, did I.

Herwig

--
Herwig Huener   http://www.quantenrente.de             +49
Josella Simone  http://www.Josella-Simone-Playton.de  8095
Playton         webmaster!@!Herwig-Huener.de          2230
GruberStrasse 10 A / D-85655 GrossHelfenDorf / Bayern / EU


Report this thread to moderator Post Follow-up to this message
Old Post
Herwig Huener & Josella Simone Playton
07-05-04 08:55 PM


Re: C-preprocessor for COBOL?
"Herwig Huener" <Herwig.Huener@fujitsu-siemens.com> wrote

> The C-preprocessor which can be used quite
> independent of C, at least in the Unix-Environment,
> can be used for other languages than C - it can
> even be used for poetry and such.

I am not convinced that the C preprocessor would be much use for
Cobol.  For example it recognises C's commenting but not Cobol's.

> Now, in the old days, when COBOL did not have
> conditional compilation, you could, for instance,
> "misuse" the C-preprocessor to have conditional
> compilation.

In the 'old days' few mainframes had C compilers (or C preprocessors)
and Unix machines did not do much Cobol.

> Also, at least some of the other
> capabilities of the C-preprocessor could also be
> used, if one dares to do so.

Maybe, but it isn't hard to write a preprocessor that can more easily
handle Cobol source, I have written a few.

> Does anyone know, whether there are/were serious
> projects where this was regulary done?

Report this thread to moderator Post Follow-up to this message
Old Post
Richard
07-06-04 01:55 AM


Re: C-preprocessor for COBOL?
Herwig Huener & Josella Simone Playton wrote:
> 2004-07-05 21:01:20 MEST
>
> Warren Simmons wrote:
> 
>
>
> That is not quite what I had in my mind.
>
> Of course a COBOL-compiler may generate C rather than
> some machine code, and it may be possible to translate
> some of the COBOL-directives of the new COBOL standard into
> C-preprocessor commands - we never did an investigation
> on this idea, maybe there are difficulties which are
> not easily overcome - but what I am thinking about
> is this kind of language-mixture:
>
> #define BLUBH
>
> #ifdef BLUBH
>        display "Mixed language conditional compilation!"
>        upon tv.
> #else
>        this is never compiled ...
> #endif
>
> This requires a C-Preprocessor and then a COBOL-compiler.
>
> Actually you are right on one thing: It is ages ago
> that I looked the last time on the pages of the Tiny
> COBOL Project - so they still exist? I had the impression
> that some of the team members lost interest on
> that project, and so, then, did I.
>
> Herwig
>
Well, I only think I know what they are doing, but
I believe their compiler is written in C, and they
use a specific this and that to do parsing. Talk to
them. They are still in business, and doing well.
They even have follow on product plans. Some of
the people seem to have to go for awhile but show
up when there is a question or problem to be solved.

It's a suggestion only. I am not a part of the team
but a regular reader of their news letters.

Warren

Report this thread to moderator Post Follow-up to this message
Old Post
Warren Simmons
07-06-04 08:55 AM


Re: C-preprocessor for COBOL?
2004-07-06 11:55:55 MESZ

"Richard" <riplin@Azonic.co.nz> schrieb:

> ...

>
> Maybe, but it isn't hard to write a preprocessor that can more easily
> handle Cobol source, I have written a few.

So did I - preprocessor for natural language, I mean.
Everybody should write a few preprocessors in a
lifetime - it's great fun - and after having played
with it a while, one finds out that emacs can do
the job just as well.

fun aside: If one writes a preprocessor for purposes
of conditional compilation for a language that has
not (yet) such a thing, one must also invent a suitable
notation - a mini-programming language, so to say.

OK - everybody should invent a new programming-language,
now and then, in a life time - it's great fun.

Herwig




Report this thread to moderator Post Follow-up to this message
Old Post
Herwig Huener
07-06-04 01:55 PM


Re: C-preprocessor for COBOL?
Herwig,
I used to hear "urban legends" of IBM mainframe shops where they used the
PL/I "macro processor" to preprocess COBOL code.  There was also a 3rd party
"vendor product" called META-COBOL which did something similar.

Personally, I never heard of the C preprocessor being used that way (and I w
ould
think that during my years at Micro Focus, I would have heard of this if it 
was
done).  OTOH, maybe someone did do such things somewhere. <G>

--
Bill Klein
wmklein <at> ix.netcom.com
"Herwig Huener" <Herwig.Huener@fujitsu-siemens.com> wrote in message
news:ccb8qe$et$1@nntp.fujitsu-siemens.com...
> 2004-07-05 12:00:00 MEST
>
> This is not supposed to be a joke.
>
> The C-preprocessor which can be used quite
> independent of C, at least in the Unix-Environment,
> can be used for other languages than C - it can
> even be used for poetry and such.
>
> Now, in the old days, when COBOL did not have
> conditional compilation, you could, for instance,
> "misuse" the C-preprocessor to have conditional
> compilation. Also, at least some of the other
> capabilities of the C-preprocessor could also be
> used, if one dares to do so.
>
> Does anyone know, whether there are/were serious
> projects where this was regulary done?
>
> Herwig
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
William M. Klein
07-06-04 08:55 PM


Re: C-preprocessor for COBOL?
2004-07-07 00:04:00 MESZ

William M. Klein wrote:

>    I used to hear "urban legends" of IBM mainframe shops where they used t
he
> PL/I "macro processor" to preprocess COBOL code.  There was also a 3rd par
ty
> "vendor product" called META-COBOL which did something similar.

Although I work, at times, on an ESQL-PreCompiler for COBOL,
I am not a friend of preprocessors. Language concepts
get blurred, and one always must keep in mind in which order
different preprocessors shall be applied.

But the need of some Preprocessing tends to surface now
and then - and one could even claim that the
Unix-philosophy - different programms communicating with
each other via pipe-connection - is nothing else than a
repeated application of the preprocessor-concept,
taken to the extreme.

Surprisingly, for little ad-hoc jobs, you oftenly get
a lot of work done in one cute little command-line.

Herwig

--
Herwig Huener   http://www.quantenrente.de             +49
Josella Simone  http://www.Josella-Simone-Playton.de  8095
Playton         webmaster!@!Herwig-Huener.de          2230
GruberStrasse 10 A / D-85655 GrossHelfenDorf / Bayern / EU


Report this thread to moderator Post Follow-up to this message
Old Post
Herwig Huener & Josella Simone Playton
07-07-04 01:55 AM


Re: C-preprocessor for COBOL?

William M. Klein wrote:
> Herwig,
>    I used to hear "urban legends" of IBM mainframe shops where they used t
he
> PL/I "macro processor" to preprocess COBOL code.  There was also a 3rd par
ty
> "vendor product" called META-COBOL which did something similar.

My shop still has old "copybooks" on file that were used by the CICS
1.6.1 MACRO preprocessor to generate COBOL code.  That use the macro
capabilities of the IBM mainframe assembler.  Some of these things
generate COBOL copybooks, ID division headers, and even procedure
division code without any Macro-level CICS calls.

Of course, that stuff is completely out of date, since Macro-Level
CICS has been off support for years.

Just for playing around, I wrote an HLASM macro to generate a skeleton
COBOL batch program with variable options for including copybooks,
record length, program name, et cetera.  It was fun, but I am NO
expert on HLASM macro coding.

--
http://arnold.trembley.home.att.net/



Report this thread to moderator Post Follow-up to this message
Old Post
Arnold Trembley
07-07-04 08:55 AM


Re: C-preprocessor for COBOL?
Herwig Huener a écrit :

> 2004-07-06 11:55:55 MESZ
>
> "Richard" <riplin@Azonic.co.nz> schrieb:
> 
> 
>
> So did I - preprocessor for natural language, I mean.
> Everybody should write a few preprocessors in a
> lifetime - it's great fun - and after having played
> with it a while, one finds out that emacs can do
> the job just as well.
>
> fun aside: If one writes a preprocessor for purposes
> of conditional compilation for a language that has
> not (yet) such a thing, one must also invent a suitable
> notation - a mini-programming language, so to say.
>

Conditional compilation is fine with the C preprocessor:
I used it to control the generation of a Postscript driver.
But as you said, conditional is already in COBOL,
and I agree with Richard for areas like commenting
and mostly way of "calling" preprocessing functions.

BTW, yes TC is still alive, although some of us can't
spend too much time on it. Life is hard these days !
Too many mergers, and too many programmers on
the market...

>
> OK - everybody should invent a new programming-language,
> now and then, in a life time - it's great fun.
>
> Herwig

--
Bernard Giroud
Open Source COBOL Tools Developer



Report this thread to moderator Post Follow-up to this message
Old Post
Bernard Giroud
07-07-04 08:55 AM


Sponsored Links




Last Thread Next Thread Next
Pages (2): [1] 2 »
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:07 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.