Eike Lange wrote:
On Tue, Jun 04, 2002 at 06:31:23AM -0400, CBFalconer wrote:
Eike Lange wrote:
In our department, we have a little conversion about Pascal-Standards:
[Units and Programs share same file]
Why would you use a unit at all if in the same file?
In fact, it wasn't my intention. I'm porting _a_lot_of_ units and programs from TP 6.0 to GPC 2.1 these days and I was complaining about the style of this mixture of units and programs by the original programmer. In fact, I very dislike the way, he did it.
He told me, that stopping after the first "end." (after unit) should stop the compiler. I don't know, why he has written the program in the same file so far. :-/
Put in those terms, he is absolutely right IMO. Anything that follows the "end ." should be ignored, in fact not even read. The period should be parsed and cause compilation to stop. I think the syntax is something like:
program ::= 'program' progparms ';' declarations block '.' ... block ::= 'begin' statement 'end'
so that reaching the final '.' MUST signal a successful compilation.