Re: Syntax ???
From: William M. Klein (wmklein_at_nospam.netcom.com)
Date: 03/19/04
- Next message: Richard: "Re: Perfrom Thru"
- Previous message: Michael Wojcik: "Re: Perfrom Thru"
- In reply to: docdwarf_at_panix.com: "Re: Syntax ???"
- Next in thread: docdwarf_at_panix.com: "Re: Syntax ???"
- Reply: docdwarf_at_panix.com: "Re: Syntax ???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 18 Mar 2004 23:10:27 GMT
The following is from the 2002 ISO Standard (and really did NOT have an exact
equivalent in any eariler Standard). There was actually a LOT of work done on
this set of wording - and it still doesn't really answer the question from the
other thread.
"5.2.1 Syntax rules
Syntax rules supplement general formats, identify equivalent words, and define
or clarify the order in which words or elements may be written to form larger
elements such as phrases, clauses, or statements. Syntax rules may also impose
restrictions on individual words or elements, relax restrictions implied by
words or elements, or define a term that may be used in the remaining syntax
rules.
The rules of the PICTURE clause specified in 13.16.38.5, Precedence rules, are
syntax rules.
When syntax rules specify that a word is synonymous with, an abbreviation for,
or equivalent to another word (or words), those words may be written
interchangeably and have the same meaning."
This definition was added (in part) because the 2002 Standard introduces a
totally new requirement (believe it or not) that a compiler MUST "flag" invalid
syntax. The requirement is worded as follows:
"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."
Another "relevant" quotation (for the original question) from the 2002 Standard
is:
"3.1.13 Limits
In general, standard COBOL specifies no upper limit on such things as the number
of statements in a compilation group or the number of operands permitted in
certain statements. A conforming implementation may place such limits. It is
recognized that these limits will vary from one implementation of standard COBOL
to another and may prevent the successful translation by a conforming
implementation of some compilation groups that meet the requirements of standard
COBOL."
--
Bill Klein
wmklein <at> ix.netcom.com
<docdwarf@panix.com> wrote in message news:c3btfj$soe$1@panix1.panix.com...
> In article <l946c.26360$%06.10908@newsread2.news.pas.earthlink.net>,
> William M. Klein <wmklein@nospam.netcom.com> wrote:
> >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.
>
> How interesting... before considering this bit o' small change, Mr Klein,
> would you be so kind as to say *where* the syntax ('syntax' being used in
> the sense of '1 a : the way in which linguistic elements (as words) are
> put together to form constitutents (as phrases or clauses') *is* defined?
>
> Such a thing does not spring, fully-formed, from some Divine brow... or is
> it possible, then, that my example of 'PERFORM PARA-A THRU PARA-C IN ORDER
> GIVING RESULT-FIELD' is, in fact, syntactically valid?
>
> (A quick web-search reveals that 'The vendor independent ANSI COBOL
> committee legislates formal, non-vendor-specific syntax and semantic
> language standards.' from
> http://www.csis.ul.ie/cobol/Course/COBOLIntro.htm ... but this is,
> admittedly, an intro-level course and such things might be taught as a
> matter of simplicity.)
>
> DD
>
- Next message: Richard: "Re: Perfrom Thru"
- Previous message: Michael Wojcik: "Re: Perfrom Thru"
- In reply to: docdwarf_at_panix.com: "Re: Syntax ???"
- Next in thread: docdwarf_at_panix.com: "Re: Syntax ???"
- Reply: docdwarf_at_panix.com: "Re: Syntax ???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|