Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: COBOL to PERL

by 5p1d3r (Hermit)
on Sep 25, 2005 at 02:57 UTC ( [id://494839]=note: print w/replies, xml ) Need Help??


in reply to COBOL to Perl

Back when I was in college I picked up a contracting job at a Cobol shop to develop a system for calculating the McCabe Metric of their source code. To do this I had to be able to parse their code well enough to be able to build program flow graphs. The Cobol grammer, does not make this a trivial task. The grammar isn't compatible with Yacc without having to perform some ugly tricks with lexical look ahead. And that was just for the less than total parsing I needed. If you wanted to parse the entire grammer you'd be in for a massive task. Cobol is about as verbose as it gets. Antlr may be a bette bet than Lex/Yaxx.

Eventually I made it work well enough that they wanted to extend the system to perform a full pre-compilation syntax check with it. Their largest file, clocking in at over 100,000 lines, took over an hour to compile which made syntax errors rather expensive. My program took a minute or so on the same file so big time savings.

Automated language conversions usually leave you with an unreadable / unmaintainable mess. I've seen conversions of far simpler languages than Cobol meet only partial success. The resultant C could be built successfully on the target platforms (for which there was no compiler for the original language). It wasn't good enough to directly maintain however so all maintenance had to be done on the original source and reconverted.

Cobol is not dead, it just smells funny.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://494839]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-16 10:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found