|COBOL Compilers Using Yacc email@example.com (1987-03-25)|
|Date:||Wed, 25 Mar 87 13:50:33 est|
|From:||firstname.lastname@example.org (Brian Renaud)|
In the UNICOM Conference Proceedings of January, 1983, there is an article
by Robert E. Conant and Herbert G. Mayer of Burroughs on their experiences
in implementing a COBOL compiler using lex and yacc. Many of their problems
were with lex (not surprisingly). Their summary of their parser problems
The first problem is that there is NO statement terminator.
How do you recover gracefully after finding an error? How do
you find the next statement? This problem was solved with
a simple heuristic which involves using a global variable for
communication between yacc and lex. A flag is set by yacc
which tells lex to deviate from its normal mode of operation
in which line terminators are ignored and tossed away, and
instead watch out for an end-of-line, and, when found, turn
the error state off and continue scanning.
Other things that needed to be dealt with included `dangling
else' (and `dangling other things') problems, and COBOL
lists (some types of which can have zero elements, some require
at least one element, and some require two or more!).
Basically, they said that yacc works reasonably well. The article is
29 pages long and probably worth reading before anyone attempts to do
the same thing themselves.
(UNICOM was a joint meeting of the Software Tools Users Group, the USENIX
Association and /usr/group.)
Brian Renaud, COSI, Inc.
USmail: 313 N. First Street, Ann Arbor, MI 48103
voice: (313) 665-8778
Return to the
Search the comp.compilers archives again.