Re: Syntax (was: Perfrom Thru

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


Date: Wed, 31 Mar 2004 00:44:37 GMT


"Peter E. C. Dashwood" <dashwood@enternet.co.nz> wrote in message
news:b3638c46.0403300645.659c53d1@posting.google.com...
> "Rick Smith" <ricksmith@mfi.net> wrote in message
news:<106dtig4llm6d99@corp.supernews.com>...
> > Peter E. C. Dashwood <dashwood@enternet.co.nz> wrote in message
<snip>
>
> This argument is not about what the COBOL standard claims as its
> definition of syntax.
>
> The fact that a compiler detects "something's wrong" does NOT make it
> a syntax error by any definition of the word, apart from the
> definition people like yourself wrote into the standard.

Peter,
  As you know, I have my own problems with the COBOL Standard and
standardization process. HOWEVER, the thing that Doc has said in several of his
posts (in my words) is that if source code follows all the rules of the STANDARD
and a compiler issues a SYNTAX error, then the compiler is not conforming.

Well "conforming" is ONLY a "Standard-defined" term. Therefore (whether good or
bad) it is what the Standard says (or in many cases does NOT say) about what is
and isn't /may or may not be a "syntax error" that is relevant to this
discussion.

When talking about "Standard COBOL" the Standard seems pretty clear to me that a
vendor MAY introduce additional syntax rules and such syntax rules MAY include
"limit violations".

As far as what was and was not put into the Standard, the 2002 Standard actually
"improved" this area when it ADDED the following which wasn't in any earlier
COBOL compiler,

"An implementation shall provide a warning mechanism that optionally can be
invoked by the user at compile time to indicate violations of the general
formats and the explicit syntax rules of standard COBOL. This warning mechanism
shall provide a suboption for selection or suppression of checking for
violations of the set of conformance rules specified in 14.7, Conformance for
parameters and returning items, and in 9.3.7.1.2, Conformance between
interfaces.

There are rules in standard COBOL that are not identified as general formats or
syntax rules, but nevertheless specify elements that are syntactically
distinguishable. This warning mechanism shall indicate violations of such rules.
For elements not specified in general formats or in explicit syntax rules, it is
left to the implementor's judgement to determine what is syntactically
distinguishable.

There are general rules in standard COBOL that could have been classified as
syntax rules. These rules are classified as general rules for the purpose of
avoiding syntax checking, and do not reflect errors in standard COBOL. An
implementation may, but is not required to, flag violations of such rules."

  ***

Please note particularly the phrase

 "it is left to the implementor's judgement to determine what is syntactically
distinguishable."

I think that (which I should have quoted earlier) pretty much answers exactly
what the Standard says about this WHOLE topic.

If those (unlike Peter) who "care" about Standard COBOL *and* who think what it
currently says is "wrong" want a future Standard to change this, then contact
either J4 or your national Standards body. If you don't want a future Standard
NOT to modify leaving this up to the vendor, then "live with" what the Standard
says about syntax - or talk about "syntax" outside of the question of "Standard
COBOL" (and/or conformance)>

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


Relevant Pages

  • Re: Program compression
    ... be interested in Seed7. ... syntax and semantic can be defined in Seed7: ... Are there standard packages available to provide these as ... Now the ability to define *variants* of those common operators ...
    (comp.programming)
  • Re: What could J4 (or WG4) do
    ... I really have no expertise in the OO arena, either in COBOL or otherwise. ... for example it's 'INSPECT REPLACING' show the standard syntax IMMEDIATELY ... may only be used to represent the leftmost leading numeric character ...
    (comp.lang.cobol)
  • Re: "Substantive Changes"
    ... These DO include cases where "old syntax" can give "new results". ... By "mistake" the '85 Standard was interpreted as REQUIRING a conforming implementation to "silently continue" on after such statements. ... But, I also realize that I came to COBOL *way* late in the game, so I have the perspective of learning from what others have done. ... Are you familiar with the rationale regarding combining EXAMINE, INSPECT, and TRANSFORM? ...
    (comp.lang.cobol)
  • Declaration to get 8-bit (or 16-bit) integer?
    ... Supported by all the current compilers that I've tried it on. ... Not likely to become standard in the foreseeable future. ... Syntax standard-conforming, but semantics not guaranteed of course. ... The meaning of the code not obvious to anyone but a Fortran guru. ...
    (comp.lang.fortran)
  • Syntax (was: Perfrom Thru
    ... > syntax errors in this code must be flagging according to non-Standard ... > when according to Standard it is. ... A conforming compiler is required to flag/indicate if a source program ... specifications include - but are not limited to "syntax rules" and "general ...
    (comp.lang.cobol)