Syntax ???

From: William M. Klein (wmklein_at_nospam.netcom.com)
Date: 03/17/04


Date: Wed, 17 Mar 2004 22:18:57 GMT

A follow-up on another thread.

As the '85 (much less '74) Standard does not "define" syntax, I wanted to add my
two (or more) cents to a discussion of what is and is not a "syntax error" in an
'85 Standard conforming compiler.

The Standard explicitly allows for an implementation to "set limits" of various
types (where the Standard has an "ellipsis" for multiple occurrences).

It would seem to me that if a vendor documents (for example) that they only
support 15 WHEN phrases in an EVALUATE statement, that coding 16 when statements
*is* a syntax error. (Hopefully, this isn't "too controversial" a view).

If a vendor documents that they only support 16M of Working-Storage, then I
would also state that if an application creates 16M + 1-byte, that this is a
"syntax error" - even if some of those "bytes" are due to "sync" clauses,
01-level boundaries or "non-visible to the programmer" issues.

Therefore, it would seem to me (and I do accept that this may be controversial)
that if a vendor documents that each paragraph in the procedure division may
result in "only" 1K of storage, that a program that "violates" this rule has
violated a "syntax rule (even if there is no way for the programmer to figure
out how to "code around" this restriction - by simply looking at source code).

If, on the other hand, the vendor does NOT document how large (object code) each
paragraph may be but "blows" registers (or whatever) at compile time, then I see
that as a "compiler error" - or - at least - not a syntax error.

OBVIOUSLY "your mileage may vary" <G>

-- 
Bill Klein
 wmklein <at> ix.netcom.com


Relevant Pages

  • Re: TR 24731 approved
    ... I worked and worked and this syntax error would never go away. ... It's part of the language, and has been for 17 years. ... Because it's an important issue in achieving a consensus standard. ... I have no means of coercing you to ...
    (comp.std.c)
  • Re: Syntax (was: Perfrom Thru
    ... If "source violates the rules of the Standard" ... Then "source must get a syntax error" ... Bill Klein ...
    (comp.lang.cobol)
  • Re: Syntax (was: Perfrom Thru
    ... It isn't about source violating the rules of the standard, ... Doc's objection is that a diagnostic from a compiler should state ... whether the problem is a compiler limitation or it is a syntax error, ... If source code violates the syntax for COBOL as laid down in the ...
    (comp.lang.cobol)
  • Re: Perfrom Thru
    ... Rick Smith wrote: ... >> implementation is not conforming to the standard. ... >As I mentioned previously, below, in my experience the compiler ... >a syntax error requiring syntactic correction, ...
    (comp.lang.cobol)