Code Comments
Programming Forum and web based access to our favorite programming groups.<docdwarf@panix.com> wrote in message news:c48tei$fug$1@panix1.panix.com... > In article <106fdie9ano6n64@corp.supernews.com>, > Rick Smith <ricksmith@mfi.net> wrote: <much snippage> > > Then, Mr Smith, if the Standard allows for a particular syntax and the > compiler throws a 'syntax error' then it would seem that the > implementation is not conforming to the standard. > That would be true. ; HOWEVER, if the Standard A) "allows for a particular syntax" *and* B) allows the implementation to place LIMITS and other additional restrictio ns on the Standard supplied syntactic specifications Then It is true the implementation MAY OR MAY NOT BE conforming to the standard, if the compiler 'throws a 'syntax error' for that particular syntax. Doc, You (and Richard and others) may not LIKE it, but the COBOL Standard (curren t and past) simply does NOT say that source code that conforms to the "syntact ic specifications" of the Standard *must* not get any additional SYNTAX errors (based on "limits violations"; use of optional features; WHATEVER) - and sti ll have the compiler considered "conforming". This may not be true for other programming languages (I don't know) but it is the case for the COBOL Standa rd. The COBOL Standard (current and past) tells you when source code MUST get a syntax error (or an extension flag). It does NOT tell you when it must get a "clean" compile (no syntax error). I have provided the information from the 2002 Standard, but for those (must of us) using an '85 Standard compiler, here is what that says on this topic, "1.7 RELATIONSHIP OF A CONFORMING PROGRAM TO A CONFORMING IMPLEMENTATION The translation of a conforming source program by a conforming implementatio n and the subsequent execution of the resultant object program is defined only to the extent specified in Standard COBOL. However, the preceding statement doe s not imply that the program will be translated or executed successfully; translation and execution depends on other factors, such as the use of implementor-defined language elements, the logical correctness of the progra m, and the data upon which the program operates. In general, Standard COBOL specifies no upper limit on such things as the nu mber of statements in a program and the number of operands permitted in certain statements. It is recognized that these limits will vary from one implementa tion of Standard COBOL to another and may prevent the successful translation of s ome programs that meet the requirements of Standard COBOL." -- Bill Klein wmklein <at> ix.netcom.com
Post Follow-up to this messageNNTP-Posting-Host: 202.27.195.196 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1080622200 4321 127.0.0.1 (30 Mar 2004 04:50:00 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 30 Mar 2004 04:50:00 +0000 (UTC) Path: kermit!newsfeed-east.nntpserver.com!nntpserver.com!newshosting.com!nx0 1.iad01.newshosting.com!news.glorb.com!postnews2.google.com!not-for-mail Xref: kermit comp.lang.cobol:86484 "William M. Klein" <wmklein@nospam.netcom.com> wrote > You (and Richard and others) may not LIKE it, but the COBOL Standard (cu rrent > and past) simply does NOT say that source code that conforms to the "synta ctic > specifications" of the Standard *must* not get any additional SYNTAX error s > (based on "limits violations"; use of optional features; WHATEVER) It is not a case of whether we like it or not. While it is perfectly true that the standard allows a compiler to output any message it likes and may call an error a 'syntax error', this does not make the source code have an error in its syntax when it is, in fact, a limitation of the system that is the cause of the error. For example if the compilation ceased because there was no disk space left, then it would be incorrect to blame the programmer as having used the wrong syntax. In the case discussed the compiler ran out of 'segment space'. There is no error in the syntax, that exact source code could be compiled correctly if it was in a different place in the program, it is not a 'syntax error'. It is irrelevant that standard makes no constraints on what error messages may be, the issue has nothing to do with what syntax is used in the source code. Your argument _may_ have some validity if the compiler was consistently rejecting a particular source structure because it couldn't handle the actual syntax, but in the case discussed it would sometimes accept the lines around the 'error' and sometimes not. The issue is _not_ the syntax.
Post Follow-up to this messageActually, in the case that began this thread, if you moved the entire PARAGR APH (or section?) anywhere else, you would get the exact same syntax error. The error in the source code (which was - according to the report - was clearly indicated) was that the source code had a syntax error in that the "procedur e's source code" (syntax) needed to be MODIFIED by the programmer to "break up" the procedural statements into smaller "pieces of syntax". HOWEVER, regardless of this, as far as COBOL goes, if you are talking about what is and is not a valid syntax error - you may ONLY apply the rules of the ANSI/ISO COBOL Standards (which are silent on this topic). You may say that you do not like a vendor's classification, but that is your opinion - NOT an iss ue of the compiler be conforming to the Standard (which is what Doc seemed to w ant to say). -- Bill Klein wmklein <at> ix.netcom.com "Richard" <riplin@Azonic.co.nz> wrote in message news:217e491a.0403292049.270bd951@posting.google.com... > "William M. Klein" <wmklein@nospam.netcom.com> wrote > (current "syntactic > > It is not a case of whether we like it or not. While it is perfectly > true that the standard allows a compiler to output any message it > likes and may call an error a 'syntax error', this does not make the > source code have an error in its syntax when it is, in fact, a > limitation of the system that is the cause of the error. > > For example if the compilation ceased because there was no disk space > left, then it would be incorrect to blame the programmer as having > used the wrong syntax. > > In the case discussed the compiler ran out of 'segment space'. There > is no error in the syntax, that exact source code could be compiled > correctly if it was in a different place in the program, it is not a > 'syntax error'. > > It is irrelevant that standard makes no constraints on what error > messages may be, the issue has nothing to do with what syntax is used > in the source code. > > Your argument _may_ have some validity if the compiler was > consistently rejecting a particular source structure because it > couldn't handle the actual syntax, but in the case discussed it would > sometimes accept the lines around the 'error' and sometimes not. The > issue is _not_ the syntax.
Post Follow-up to this messageAm 29.03.04 schrieb riplin@Azonic.co.nz (Richard) auf /COMP/LANG/COBOL in 217e491a.0403292049.270bd951@posting.google.com ueber Re: Perfrom Thru (really syntax) r> "William M. Klein" <wmklein@nospam.netcom.com> wrote WmK>> You (and Richard and others) may not LIKE it, but the WmK>> COBOL Standard (current and past) simply does NOT say that WmK>> source code that conforms to the "syntactic specifications" of WmK>> the Standard *must* not get any additional SYNTAX errors (based WmK>> on "limits violations"; use of optional features; WHATEVER) r> It is not a case of whether we like it or not. While it is perfectly r> true that the standard allows a compiler to output any message it r> likes and may call an error a 'syntax error', this does not make the r> source code have an error in its syntax when it is, in fact, a r> limitation of the system that is the cause of the error. The standard defines only an _abstract_ syntax, leaving out implementation-specific limitations, but specifying explicitly, that an implementation will and can impose limitations. A concrete compilation unit does have to conform to the syntactic contraints imposed by the concrete compiler, not some abstract syntax. When you want a program to be checked only against the abstract syntax of the language standard, then you will also only get abstract program which don't execute in reality, but only in abstract, i.e. in your mind. When a real world compiler concretizes the standard by imposing certain limits on, say the number of WHEN clauses in an EVALUATE statement, then exceeding these limits is a syntax error. The concrete error message in this case would probably be: "xxx exceeds the number of allowable WHEN clauses". Yours, Lüko Willms http://www.mlwerke.de /--------- L.WILLMS@jpberlin.de -- Alle Rechte vorbehalten -- "Ohne Pressefreiheit, Vereins- und Versammlungsrecht ist keine Arbeiterbewegung möglich" - Friedrich Engels (Februar 1865)
Post Follow-up to this messageIn article <po0ac.6015$Dv2.2893@newsread2.news.pas.earthlink.net>, William M. Klein <wmklein@nospam.netcom.com> wrote: ><docdwarf@panix.com> wrote in message news:c48tei$fug$1@panix1.panix.com... ><much snippage> > >That would be true. ; HOWEVER, if the Standard > A) "allows for a particular syntax" > *and* > B) allows the implementation to place LIMITS and other additional restric tions >on the Standard supplied syntactic specifications > >Then > It is true the implementation MAY OR MAY NOT BE conforming to the stand ard, >if the compiler 'throws a 'syntax error' for that particular syntax. Mr Klein, this seems remarkably similar to a formulation found in <http://groups.google.com/groups?sel... &output=gplain> --begin quoted text: 'It appears here, Mr Klein, that a vendor's implementation '...MUST include the "Syntax Rules" and "general Formats" of the Standard'. If that is the case then a compiler which returns a syntax error for code which complies with the Standard's Syntax Rules is neither right nor wrong.' --end quoted text [snip] > The COBOL Standard (current and past) tells you when source code MUST get a >syntax error (or an extension flag). It does NOT tell you when it must get a >"clean" compile (no syntax error). Mr Klein, this is astounding. The Standard lists all possible errors and says 'none of these are any good' and gives no example of 'this is acceptable syntax'? It must be a much larger document than I imagined! DD
Post Follow-up to this messageIn article <b_9ac.8135$lt2.7006@newsread1.news.pas.earthlink.net>, William M. Klein <wmklein@nospam.netcom.com> wrote: [snip] >HOWEVER, regardless of this, as far as COBOL goes, if you are talking about what >is and is not a valid syntax error - you may ONLY apply the rules of the >ANSI/ISO COBOL Standards (which are silent on this topic). Mr Klein, you may have hit upon something here. Consider: The rules of the ANSI/ISO COBOL Standard say nothing about this condition. The compiler says something (syntax error) about this condition. The compiler says something (syntax error) which is not in the rules of the ANSI/ISO COBOL Standard. Have I made an error in definitions or logic here? The syllogism appears to be valid. DD
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.