ExpungeOpensDoc.tioga
Michael Plass, January 24, 1986 12:54:44 pm PST
ExpungeOpens
CEDAR 6.0 — FOR INTERNAL XEROX USE ONLY
ExpungeOpens
Michael Plass
© Copyright 1986 Xerox Corporation. All rights reserved.
Abstract: Command for expanding unnamed OPEN statements in Cedar programs, and prettyprinting them.
Created by: Michael Plass
Maintained by: Michael Plass <Plass.pa>
Keywords: prettyprint, OPEN, programming style
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
Commands:
ExpungeOpens BananaImpl
will remove unnamed OPENs from BananaImpl.mesa and prettify the indentation.
Bugs:
Note that the bug list is the longest part of the documentation.
This program is yaahcp (yet another ad-hoc Cedar parser) and does not understand all the nuances of the Cedar language. Therefore there is a chance that your program will not compile after ExpungeOpens is done with it. However, it should not not mangle it too badly, and a edit-compile pass or two should fix things up. If your program has no OPEN statements, nothing bad should happen.
Your program must be compiled before running ExpungeOpens, since ExpungeOpens runs the UsingLister to generate some of its information.
If the same name is obtained from multiple interfaces, the result might be wrong.
ExpungeOpens sets the keep of the source file to 6, so if it botches the job really badly, you can recover an old version.
It goes through a WriteMesaPlain - process - TiogaMesa sequence, so any fancy Tioga formatting will be lost and replaced with the standard TiogaMesa fare.
The prettyprinting includes adjusting the indentation, replacing BEGIN . . . END with { . . . }, and fiddling with line breaks near { and } a little. If this is not to your liking, try setting the globals useCurlys, adjustLineBreaks, and/or adjustIndentation with the interpreter.