Re: More Basics and parsing Cobol

28 Jul 1998 11:36:39 -0400

          From comp.compilers

Related articles
Re: More Basics and parsing Cobol (Vadim Maslov) (1998-07-27)
Re: More Basics and parsing Cobol (1998-07-28)
| List of all articles for this month |

From: <>
Newsgroups: comp.compilers
Date: 28 Jul 1998 11:36:39 -0400
Organization: Compilers Central
Keywords: parse, Cobol, practice

What I see in the reengineering business now is a lot of patchy Cobol
parsers cooked up by fresh students of Yacc and Lex or other similar

If these people are good, they finally learn that Cobol parsing is too
damn complicated, that language is too huge and whoever wrote the
standard did not take parser writers in consideration (do you consider
language whose grammar takes 6,000+ lines complicated or simple?, what
about 20 distinct dialects that are not really compatible?).

This is true. After writing an Algol 60 compiler I worked on a COBOL
one in collaboration with its original author. The syntax of Algol is
defined exactly and recursively in the Algol 60 report, writing a
compiler by the recursive descent method was based on re-wriing the
Algol 60 report in Algol. (Semantics and how to implement them are
something else). Syntax analysis was not attempted in the COBOL
compiler, for the reasons stated above. It was essentially a giant
lookup table, the skill was knowing what to put into the table and how
to look it up fast.

All this was too long ago for Yacc and Lex to be in the picture, yet
they are mentioned in the majority of posts to this group. I have only
a vague understanding of what they are. Nor can I see any use for
mathematics, at least not the type I learned as an engineer.. What am
I missing here? Would writing the Algol compiler have been any easier
if I had used these tools? Would they have shown me the answer to
some of the implementation problems I spend hours pondering? Or are
the younger generation missing something in turning to tools instead
of having to think things through down to the deepest level?

You can download the Algol 60 (MSDOS or a DOS box, there are no BIOS
calls) from There is full documentation
including the compiler source, opcodes, stack layout etc.

Roger Abbott

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.