Re: Syntax ???

docdwarf_at_panix.com
Date: 03/19/04


Date: 18 Mar 2004 19:11:08 -0500

In article <D%p6c.47066$aT1.14038@newsread1.news.pas.earthlink.net>,
William M. Klein <wmklein@nospam.netcom.com> wrote:
>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.

This sounds remarkably close to the http://www.m-w.com definition of
'syntax' as 'the way in which linguistic elements (as words) are put
together to form constitutents (as phrases or clauses')'

>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.

This appears to agree with my response to Mr Willm in which I mentioned
the data-type changing syntax (in that the target field of a COMPUTE must
be numeric/numeric-edited).

>
>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.

To hack up the annoying 'That was then, this is now'... this is now, what
was that, then? The COBOL mentioned by Mr Stevens is thirty years old...
is it possible that there's been no standard of COBOL syntax ever, before
now?

[snip]

>There are rules in standard COBOL that are not identified as general formats or
>syntax rules, but nevertheless specify elements that are syntactically
>distinguishable.

Here, at least, is a definite statement: there are rules in standard COBOL
that are not identified as syntax rules. It does not state whether there
are rules in standard COBOL which *are* identified as syntax rules... so
my question of 'where is the syntax of COBOL defined?' remains unanswered.

[snip]

>There are general rules in standard COBOL that could have been classified as
>syntax rules.

And once again... something that 'could have been classified as syntax
rules'... but nothing about 'that which has been classified as syntax
rules'. (I am considering, at present, 'syntax' and 'syntax rules' to be
equivalent terms given the citing from www.dictionary.com, AHD 2. Computer
Science. The rules governing the formation of statements in a programming
language)

Mr Klein has already asserted that neither the ANSI Standard of 1974 nor
the ANSI Standard of 1985 "define" (quotations original) syntax... and my
question of 'where, then *is* (or was) it defined?' seems still to be
unanswered. It would be *most* droll if no answer is found, if there is
nothing which can be pointed to and described as 'there is where the
syntax of COBOL is defined'...

... because if the syntax is undefined how, then, can anyone speak of a
syntax error?

DD

><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
>>
>
>



Relevant Pages

  • 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: Syntax (was: Perfrom Thru
    ... > This argument is not about what the COBOL standard claims as its ... > definition of syntax. ... > definition people like yourself wrote into the standard. ... invoked by the user at compile time to indicate violations of the general ...
    (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)
  • Re: Syntax (was: Perfrom Thru
    ... Mr Klein. ... >> syntax... ... >> when according to Standard it is. ... The above appears to state that "syntax rules" (the function of these ...
    (comp.lang.cobol)
  • 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)