cobolforgcc-devel Mailing List for Cobol for GCC (Page 10)
Status: Pre-Alpha
Brought to you by:
timjosling
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(20) |
Sep
(2) |
Oct
(4) |
Nov
(16) |
Dec
(15) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(13) |
Feb
(5) |
Mar
(21) |
Apr
(34) |
May
(9) |
Jun
(22) |
Jul
|
Aug
(6) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2002 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(24) |
Jul
(1) |
Aug
|
Sep
(4) |
Oct
(6) |
Nov
|
Dec
(1) |
2003 |
Jan
(2) |
Feb
|
Mar
|
Apr
(11) |
May
(19) |
Jun
(2) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2008 |
Jan
(15) |
Feb
(4) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: Tim J. <te...@me...> - 2000-12-04 19:48:38
|
A minor milestone. Last night I compiled and ran the COBOL equivalent of "Hello World" using COBOLforGCC. Functionally this is not much, but it shows that I have fully integrated cobol4gcc into the GCC environment, including the high level gcc driver, anbd code generation back end. Now I will be adding function at a rapid pace until I get the compikler subset going. At that time I will do a release for COBOL programmers to use. I am on holidays next week so hopefully I can get lots done. Tim Josling |
From: Daniel H. A. <dar...@ar...> - 2000-11-27 22:57:28
|
Tim, Thanks for your comments about my english. I'm an Argentine guy, I use to speak spanish outside work. You know the cuntry, same latitude of Australia, on the other side of the world :). Ok, I will check the examples and do all the modification. As soon as I have it all ready I will go back to you. Regards, Daniel ----- Original Message ----- From: "Tim Josling" <te...@me...> To: "Daniel H. Ardison" <dar...@ar...> Cc: "cobolforgcc-devel" <cob...@li...> Sent: Lunes 27 de Noviembre de 2000 5:56 PM Subject: Re: Bugs Resolution > Daniel, > > What is your native language? Your English is just about perfect. > > You can have a look at a test program here: > http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/gcc/cobol/test_cobr_decbin.c?r ev=1.4&content-type=text/x-cvsweb-markup&cvsroot=CobolForGCC > > The basic concept is simple. The test program outputs the results > of the tests. First time, we manually check them. After that we > compare the output to the previous output and complain if there > are differences. > > Sample output: > > Test 1. > input: "aaa" > replacing: "aaa" by "bbb" > replacing: "bbb" by "ccc" > output: "ccc" > > Test 2. > ...etc > > It is a pain to set up the tests first time, but it is great > after that because you can clean up the code and make changes > without fear because you can quickly run the tests to make sure > everything is still OK. > > See www.xprogramming.com under 'test first design'. In theory you > are supposed to write the test first then the code. You keep > coding until the test works. Then you write another test. > Sometimes the test works already without doing any coding. > > Regards, > Tim Josling > > > > "Daniel H. Ardison" wrote: > > > > Tim, > > > > I will do the following: > > > > - cobr_insind.c > > > > I will put comments regarding that the returning value starts > > at position 1. I don't need a pointer I need the starting > > numeric position, see the code involved. > > > > - cobr_insrep.c > > > > I will modify cobr_insrep.c interface parameters so the caller > > will pass three pointers to unsigned int array > > occurs replacing_count times. Then I will not need any > > allocation checking. > > > > Talking about test software I'm not sure what you want, maybe > > that's because english is not my mother's language :).Anyway > > could you send or point me to an example? > > > > Regards, > > Daniel > > > > > |
From: Tim J. <te...@me...> - 2000-11-27 21:00:28
|
Daniel, What is your native language? Your English is just about perfect. You can have a look at a test program here: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/gcc/cobol/test_cobr_decbin.c?rev=1.4&content-type=text/x-cvsweb-markup&cvsroot=CobolForGCC The basic concept is simple. The test program outputs the results of the tests. First time, we manually check them. After that we compare the output to the previous output and complain if there are differences. Sample output: Test 1. input: "aaa" replacing: "aaa" by "bbb" replacing: "bbb" by "ccc" output: "ccc" Test 2. ...etc It is a pain to set up the tests first time, but it is great after that because you can clean up the code and make changes without fear because you can quickly run the tests to make sure everything is still OK. See www.xprogramming.com under 'test first design'. In theory you are supposed to write the test first then the code. You keep coding until the test works. Then you write another test. Sometimes the test works already without doing any coding. Regards, Tim Josling > "Daniel H. Ardison" wrote: > > Tim, > > I will do the following: > > - cobr_insind.c > > I will put comments regarding that the returning value starts > at position 1. I don't need a pointer I need the starting > numeric position, see the code involved. > > - cobr_insrep.c > > I will modify cobr_insrep.c interface parameters so the caller > will pass three pointers to unsigned int array > occurs replacing_count times. Then I will not need any > allocation checking. > > Talking about test software I'm not sure what you want, maybe > that's because english is not my mother's language :).Anyway > could you send or point me to an example? > > Regards, > Daniel > > |
From: Daniel H. A. <dar...@ar...> - 2000-11-27 20:41:38
|
Tim, I will do the following: - cobr_insind.c I will put comments regarding that the returning value starts at = position 1. I don't need a pointer I need the starting numeric = position, see the code involved. - cobr_insrep.c I will modify cobr_insrep.c interface parameters so the caller will pass = three pointers to unsigned int array occurs replacing_count times. Then = I will not need any allocation checking. Talking about test software I'm not sure what you want, maybe that's = because english is not my mother's language :).Anyway could you send or = point me to an example? Regards, Daniel |
From: Tim J. <te...@me...> - 2000-11-27 19:36:02
|
Daniel, Yes sorry I should have mentioned that I sent the source seperately because the listserv doesn't like attachments. See below, Tim Josling "Daniel H. Ardison" wrote: > > Tim, > > Forget the mails I sent you during the weekend, today I found the mail you > sent me with the bugs at the office. > Regarding the bugs I have this comments: > > - cobr_insind.c > > The way I see it indexof returns 0 if there is no mutch, and returns > position starting at 1 otherwise. If I need to use 0 starting position I > will substract the returned value. I took this from awk indexof interface. I > could change this to return -1 if you want, but I will need to change the > use of indexof on the other routines. > Maybe I should comment at the begining of the file that starting position > returned is 1, ok I will do it. You are right it is not a bug. So if the substring starts at offset 0 then you return 1, if at offset 2 you return 2, etc, if not found you return 0 - is that right? Commenting to clarify it is OK, although returning a pointer may be more elegant. But it is up to you - adding a comment would suffice; I don't want to get into micromanaging anyone's coding, as long as the code is in the FSF standards. > > - cobr_insrep.c > > I agree with you that could be a memory leak and that I don't check for > allocation success. > Now, talking about checking, in which way runtime errors will be treated? > You define all the interfaces returning void, Do you want that I use errno? > I don't see that the caller could pass some auxiliar memory area, this is > basically local info for local processing, I don't see why the caller should > know that the routine needs auxiliar memory. I see returning a rutime error > is the only way at the moment. Storage allocation: the caller is the compiler so it is OK to expect it to do certain things like pass a workarea, that you may not want to do in a normal API- the compiler and runtime are tightly linked. Normally I would only want to do getmains for something that is inherently slow like IO or sorting. It looks like you want three ints per replacing count, which should be easy to provide. Error handling: COBOL has no provision for this outside of some of the IO. The caller can expect that inspect will work or the program will die. So how to die? Just call abort() for now and put in a comment that we need to have a standard way to have the runtime crash (/* lll; need to have a standard way to abort */ where lll; is just a way to mark code that needs to be worked on later . > > Please let me know what you think. > > Regards, > > Daniel |
From: Daniel A. <dar...@ho...> - 2000-11-27 04:58:13
|
Tim, You told me in your mails that there are some bugs in the file I should check out. The problem is that I couldn't found the files at sourceforge. Could you tell me where are they? Thanks. Daniel _____________________________________________________________________________________ Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com |
From: Tim J. <te...@me...> - 2000-11-26 03:45:48
|
Steven, Look at cobumem.c and cobutil.c in the CVS for examples. I have pasted one below. Note that asserts do not have to be protected by the #if, because they do nothing if NDEBUG is set. Thus the two naked asserts at the end. If the debugging is on, I do lots of checks for integrity of the memory allocation, buffer overrunrs etc. Each allocated area has a magic number for validation, and the length etc. This all disappears when debug is turned off. So, for example, you can put assert(pointer1!=NULL); and such all over the place. You could check that the parameters passed are consistent. The only thing to be careful of is to make sure none of the operational code is in asserts or within the #ifndef scope. This would be bad int next_ix=0; assert(next_ix++<MAX); << increament won't happen if debug turned off item[next_ix]=stuff; By the way if you register with sourceforge I can record your work in the task tracking system. Regards, Tim Josling > #ifndef NDEBUG > for (mem=first_malloc; mem; mem=mem->next) > { > > counter++; > totaller+=mem->size; > > assert(mem->size>0); > assert(mem->magic==MAGIC1); > > if (mem==first_malloc) > assert(!(mem->prev)); > else > { > assert (mem->prev); > assert (mem->prev->next==mem); > } > if (mem==last_malloc) > assert(!(mem->next)); > else > { > assert (mem->next); > assert (mem->next->prev==mem); > } > > memend=(struct malloc_trailer*)(((char*)mem)+(mem->size)+sizeof(struct malloc_header)); > assert(memend->magic==MAGIC2); > > } > > #endif > assert(counter==(malloc_count-free_count)); > assert(totaller==(malloc_total-free_total)); |
From: Steven O. E. <so...@so...> - 2000-11-26 00:33:47
|
Thanks, Tim. Suppose there is an error, then. What do I use for an error routine in the "ifndef NDEBUG" code? Is there an example somewhere? Steven > Steven, > > OK feel free to put the number of items back in. You can use it > in validation, bracketed by > > #ifndef NDEBUG > ....... > #endif > In terms of discussion, my ideal scenario would be for you to > subscribe to the cobolforgcc-devel mailing list and put the > discussion in there. > If you register in sourceforge we could also start tracking your > work as tasks in their too. > Regards, > Tim Josling > "Steven O. Ellis" wrote: >> >> Tim, >> >> Yes, this way of defining the test arrays ought to help immensely. I didn't think >> of that. Thanks! >> >> cobr_string.c looks good! However, I'm a little uneasy about not including the >> number of items in the from array, even if it's not used in the current >> implementation, because of the (theoretical) possibility of an overflow. I >> didn't use it because there's no parameter checking, but I wonder if there should >> be some kind of check in this case. Are we so sure that no one will ever pass too >> many delimiters for the number of items? >> >> I entered this into the SourceForge discussion group per your request--please let >> me know if this is what you had in mind. >> >> Steven |
From: Tim J. <te...@me...> - 2000-11-25 11:35:09
|
Daniel, Thanks. Just a few issues here - possible memory leak (find bug). - some extra comments needed (find bug for one) - need to make the testing automatic (even if limited # tests at this stage). Next iteration I will integrate into the source tree and upload to sourceforge. Don't worry about the makefile. If you are not using GCC, try and turn on as many pedantic fussy warnings as feasible (eg check function prototypes are there, variables not used, etc). Regards, Tim Josling > "Daniel H. Ardison" wrote: > > Tim, > > Attached to this I send you the Inspect Replacing routine. I > made some intensive testing on it, but who knows. > Please let know if everything is ok. > > Daniel > > > Name: Replacing.zip > Replacing.zip Type: Zip Compressed Data > (application/x-zip-compressed) > Encoding: base64 |
From: Tim J. <te...@me...> - 2000-11-25 11:35:04
|
Daniel, Thanks. I've been through it and I'm mostly very happy with it. I reindented it according to the GNU coding standards, and added a comment before every function according to the GNU coding standards. There are a couple of possible bugs (do a "find bug" in the source) - could you check these out for me. The test cases seem to rely on someone entering test data. I need to be able to run the tests totally automatically - could you put the test data into the test program and then drive the test multiple times from that. See Ted's test programs for examples of how he did it. I also renamed the test file in accordance with the other ones ie test_<name of program being tested>, Keep up the good work. I will look at the inspect replacing now, Regards, Tim Josling > "Daniel H. Ardison" wrote: > > Dear Tim, > > I send you here the inspect converting routines. The package > includes a test program. > Sorry I don't have time to write a makefile, I'm actually using > Visual C++ to program this so I don't need it. > I promise I will write one for the hold project if you need it. > I made preliminary testing on the routine on my PC and on Linux > at work. It seems to work fine. > I think I will do intensive testing for the hold project when I > finish it. > cobr_inspect_substring routine is not tested yet. I didn't used > in convert routine and maybe I don't use it at all. > > > Please feel free to send me any feedback. > > Daniel > > > Name: convert.zip > convert.zip Type: Zip Compressed Data > (application/x-zip-compressed) > Encoding: base64 |
From: Tim J. <te...@me...> - 2000-11-24 23:36:24
|
Bill, I have some questions are the CD1.10 document which you emailed the cobolforgcc groups a while back. I know you are busy so I will try and be as concise and clear as possible. 1. There appears to be no way to have functions that have a variable number of arguments. You can have optional arguments, but whereas, in C, functions like printf can have an unlimited number of arguments, it appears that this is not possible in CD1.10. Was this a deliberate omission? Obviously it makes it difficult to interface into existing C libraries. 2. In S4.151, the definition of program prototype seems to be wrong, cloned from the previous definition. 3. There is a pointer to a program (8.4.2.11.3) but not to a function. Is this deliberate? It again makes it difficult to interface to C libraries, where for example when calling qsort you have to pass a function pointer. 4. In C.23, 'bit they can' should be 'but they can'. 5. There seems to be a duplication of specification in that in the prototype you say 'X as "y"' and you say that also in the repository paragraph. It seems the 'as "y"' name is the real name and the X name is just a local name which is not externalized. Is that correct? For example, if the prototype said 'X as "y"' and I had 'A as "Y"' are they referring to the same function? ---- I would like to write as much of my COBOL compiler in COBOl as possible, so I am first working on a subset of the language. This will require access to the C library for many functions, such as IO. I would like to use the COBOL 2002 standard where it helps in the regard, particularly functions, binary data items and prototypes. Maybe also BIT types and boolean operations. The main issue is the function prototypes. I don't really have a very clear idea of the role of the repository, and to me it seems to make life a little more complex, so I want to avoid it if possible for now. So what I was intending to do was have each program do as follows: ** get prototypes of all functions used... COPY FPRINTF. * FPRINTF will be some code containing the prototype for fprintf as follows: *** start copy ID division. FUNCTION-ID. FPRINTF as "fprintf" is prototype. ...etc end-function fprintf. *** end copy ID DIVISION. PROGRAM-ID. X1. ... REPOSITORY. FUNCTION FPRINTF as "fprintf". ... Procedure division. result=FPRINTF(a,b,c). ... end-program x1. ----------------- As far as I can tell, this will be legal COBOL 2002. Does this approach seem sensible to you, or should I adopt a different approach. What is the role of the repository? As far as I can tell it works like this: 1. You do compiles and tell the compiler to place the prototypes for functions classes and interfaces into the repository. This is how the repository get populated. 2. You compile other programs and reference the programs in the repository via the repository paragraph. This is how the repository gets used. The reason for the repository would seem to be, to allow the prototype information to be stored in very efficient form. As everyone knows, in C++ most compilation times are dominated by the processing of the headers. Is my supposition correct? Or is there another reason? Regards, Tim Josling |
From: Tim J. <te...@me...> - 2000-11-24 21:47:47
|
Forwarded... Daniel Ardison wrote: > > Tim, > > Sorry, I don't fill the Subject, (Sin Asunto) means no subject. > > It's ok to e-mail via sourceforge, even I'm experimenting some problems to > connect at work, but I will upgrade IExplorer and see what happens. > > You can mention me at your Cobol column, thanks. Please send me a copy or > tell me where can I get one. > > I will send you my SourceForge ID as soon as I find it, the only thing I > know now is that my login name is : dardison . > > Talking about SQL embedded, the problem is not grammar, the problem is that > SQL APIs are propietary, and different SQL Flavors have differents APIs. I > agree with you that should be a preprocessor that convert EXEC SQL ... > END-EXEC to cobol CALLs to the API libraries. > Maybe if we can find the APIs spec and software, for informix for linux for > example, we could write a preprocessor for that API. > Another approach is to find if any vendor have Embedded SQL for GCC on > linux, and then write a layer in C to do the link. > Let me know what you think about the issue. > > I finish testing of inspect replacing today. I also do the tabs clean up you > ask for. I also found some bugs at cobr_insind.c (cobr_inspect_indexof > routine) and I correct them so I will resend you the hold package. > > Sorry I don't answer this via SourceForge but I can't login at work > actually. I will resolved asap. > > Regards, > > Daniel > |
From: Tim J. <te...@me...> - 2000-11-23 20:11:12
|
Daniel, Good. I have added you as a developer on the project and assigned the inspect task to you. I will have a look at your code tonight or tomorrow, Regards, Tim Josling > Tim, > > Sorry, I don't fill the Subject, (Sin Asunto) means no subject. > > It's ok to e-mail via sourceforge, even I'm experimenting some problems to > connect at work, but I will upgrade IExplorer and see what happens. > > You can mention me at your Cobol column, thanks. Please send me a copy or > tell me where can I get one. > > I will send you my SourceForge ID as soon as I find it, the only thing I > know now is that my login name is : dardison . > > Talking about SQL embedded, the problem is not grammar, the problem is that > SQL APIs are propietary, and different SQL Flavors have differents APIs. I > agree with you that should be a preprocessor that convert EXEC SQL ... > END-EXEC to cobol CALLs to the API libraries. > Maybe if we can find the APIs spec and software, for informix for linux for > example, we could write a preprocessor for that API. > Another approach is to find if any vendor have Embedded SQL for GCC on > linux, and then write a layer in C to do the link. > Let me know what you think about the issue. > > I finish testing of inspect replacing today. I also do the tabs clean up you > ask for. I also found some bugs at cobr_insind.c (cobr_inspect_indexof > routine) and I correct them so I will resend you the hold package. > > Sorry I don't answer this via SourceForge but I can't login at work > actually. I will resolved asap. > > Regards, > |
From: Tim J. <te...@me...> - 2000-11-22 20:39:22
|
As some of you may know, I write a column for the COBOL report (http://www.cobolreport.com) on free COBOL every couple of months. I donate the fee to the FSF. My next one is due Monday. Here is what I will be talking about. If anyone has anything else of interest to the COBOL and/or free software communities please let me know. News, issues, opinions, factoids, whatever. - Updates and enhancements to cobol4gcc and tiny cobol. Current overall statuses. - cobol4gcc attracting more developers. Once the nucleus subset is done COBOL developers can help. - Tiny cobol starting to attract real users, ported to bsd, Rildo Pragana Interview in LinuxAlianza. - Release of cobol compiler test suite by NIST and confirmation that free projects can use it. - Feature list of tiny COBOL V0.3 - what's done and what's not done - Mention open source track at cobol world 2001 conference (October 2001) Tim Josling |
From: Tim J. <te...@me...> - 2000-11-22 20:39:19
|
I have more or less finished my DBase to Java conversion project which sidetracked me for about five months, and I've started intensive work on the COBOL4GCC project again. While I was away, Ted Seward wrote a lot of runtime code and test cases: - display - move edited - conversion between binary and decimal - stop statement - 128 bit arithmetic routines Steven Ellis wrote the 'string' runtime routines. Daniel Ardison has written about 1/2 of the runtime for the inspect verb. Matthew Vanecek also contributed a cobol.el file. This provides cobol source editing facilities under the emacs text editer. I also kept the code up to date with the GCC weekly snapshots. The current cvs code supports the 22 November snapshot. Current work under way is: Tim Josling - finish the code generation for the COBOL nucleus subset to be used to write most of the compiler runtime and of the phase B compiler (ie in COBOL). Daniel Ardison - complete the inspect runtime (quite complex). Steven Ellis - complete test cases for string runtime. Ted Seward - currently on leave due to work commitments. Upcoming tasks include unstring and sort, and interfacing to gmp for infinite precision/size arithmetic. Could I suggest anyone who is developing for Cobol4GCC to register at sourceforge. That makes it a lot easier to track tasks etc. For the same reason I prefer to have any emails (other than with code attached) sent via the cobolforgcc-devel mailing list. That way there is a history of specs etc. If anyone objects to my copying correspondence to the cobolforgcc-devel mailing lists please let me know. Tim Josling |
From: Tim J. <te...@me...> - 2000-11-22 11:20:40
|
Daniel, I'd like to email via the list on sourceforge (cobolforgcc-devel). I will copy this one to the list - hope that's OK. The good thing about that is that there is a log, a history. If you send me your sourceforge ID I will put your current projects in there. I have a couple of other people writing code but it's all via private email. Hard to keep track of and also there is no apparent activity. This weekend is all for the COBOL compiler. First full weekend since May. Now I have almost finished my outside work assignment it is full steam ahead. I think the SQL will probably be a preprocessor like the IBM one. Embedded SQL is a lot nicer than JCBC or IDBC IMO. It should not be too hard actually - there are SQL grammars out there you can use. I don't know Latin but I will loook sin asunto up. I am doing my column for cobolreport.com this weekend - OK if I mention you as a contributor? Tim Josling Dan...@ao... wrote: > > Tim, > > How you doing? > I made the registration to SourceForge.net site. what's next? > I subscribed to the develop mailing list, but I only found 1 message. > how are you dealing with this? Do I add my tasks there? > Please let me know. > Talking about development I was a little busy this days, anyway I think that > inspect replacing will be ready soon. I almost finished testing and I have to > make a few arrangements. Maybe by the end of the week. not a promise. After > that tallying will be a piece of cake, it looks very similar to replacing. > by the way I received you gcc compiler options, thanks. > Talking about the hold project, I was wondering do you plan to give any > support to embebed technology, I mean EXEC SQL .... END-EXEC for example? > Maybe this could be far away in your schedulle, but I saw a lot of Cobol code > written that use embebed SQL instead of ISAM FILE for database support. > I'm not talking about mainframes, but in Unix boxes is very common. > If you are interested on this please let me know I have the expertise and I > have 4 milles of Cobol code to test with. > > Regards, > > Daniel |
From: William M. K. <wm...@ix...> - 2000-11-16 22:10:05
|
From comp.lang.cobol - in case you are interested (or want to be "amused"). You may want to "store" this in your test-bucket for when you do an ISO 200x conforming compiler. "Herwig Huener" <Herwig.Huener!@!fujitsu-siemens.com> wrote in message news:<8v131j$3s3$1...@ne...>... > 2000-11-16 17:47:27 MET > > Hi, > > below is a ready-to-go program conforming to the new > upcoming Cobol Standard. Actually, it is very few > Cobol - most stuff is directives. Purpose: a 4-digit > number in which not all digits are the same ("1111" etc) > is put into a compiler-variable and > digested by the simple well-known algorithm: > Arange the digits to make the largest and the smallest > number, subtract those two from each other and > repeat all that at most seven times over. You will > always arrive at the number 6174. > > (Strange enough that this simple property of > 4-digit numbers was discovered as late as 1949!) > > If one wants a real tough test-program for > a Cobol-compiler for the new standard, repeat > the code below for all possible 4-digits numbers > - things could be made easier by using > library elements - and you will force your > compiler to chew through about 5 million lines > of code. > > Next project is to compute Pi with directives - which > is more difficult because compiler-variables may not > have floating-point values ... > > Have fun. Herwig > > cut here: > > ------------------------------------------------------------------- > > ID DIVISION. > PROGRAM-ID. QDIR045. > environment division. > CONFIGURATION SECTION. > SPECIAL-NAMES. > TERMINAL IS TV. > INPUT-OUTPUT SECTION. > DATA DIVISION. > WORKING-STORAGE SECTION. > 01 error-counter pic 9999. > 01 correct-counter pic 9999. > PROCEDURE DIVISION. > > move zero to error-counter. > move zero to correct-counter. > > display "***************************************" upon tv. > display "* QDIR045: 2000-11-16 17:25:00 MEZ *" upon tv. > display "* QDIR045: Conditional Compilation *" upon tv. > display "* QDIR045: Kaprekar! *" upon tv. > display "***************************************" upon tv. > > >> define kaprekar as 9876 > > *************************************************************** > > >> define a as kaprekar / 1000 > >> define b as kaprekar / 100 > >> define c as kaprekar / 10 > >> define d as kaprekar > > >> define aa as a > >> define bb as b - 10 * a > >> define cc as c - 10 * b > >> define dd as d - 10 * c > > >> define a as aa override > >> define b as bb override > >> define c as cc override > >> define d as dd override > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> if b < c > >> define qqq as b > >> define b as c override > >> define c as qqq override > >> define qqq as off > >> end-if > > >> if c < d > >> define qqq as c > >> define c as d override > >> define d as qqq override > >> define qqq as off > >> end-if > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> if b < c > >> define qqq as b > >> define b as c override > >> define c as qqq override > >> define qqq as off > >> end-if > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> define max as a * 1000 + b * 100 + c * 10 + d > >> define min as d * 1000 + c * 100 + b * 10 + a > > >> define kaprekar as max - min override > > >> define max as off > >> define min as off > > >> define a as off > >> define b as off > >> define c as off > >> define d as off > > >> define aa as off > >> define bb as off > >> define cc as off > >> define dd as off > > *************************************************************** > > >> define a as kaprekar / 1000 > >> define b as kaprekar / 100 > >> define c as kaprekar / 10 > >> define d as kaprekar > > >> define aa as a > >> define bb as b - 10 * a > >> define cc as c - 10 * b > >> define dd as d - 10 * c > > >> define a as aa override > >> define b as bb override > >> define c as cc override > >> define d as dd override > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> if b < c > >> define qqq as b > >> define b as c override > >> define c as qqq override > >> define qqq as off > >> end-if > > >> if c < d > >> define qqq as c > >> define c as d override > >> define d as qqq override > >> define qqq as off > >> end-if > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> if b < c > >> define qqq as b > >> define b as c override > >> define c as qqq override > >> define qqq as off > >> end-if > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> define max as a * 1000 + b * 100 + c * 10 + d > >> define min as d * 1000 + c * 100 + b * 10 + a > > >> define kaprekar as max - min override > > >> define max as off > >> define min as off > > >> define a as off > >> define b as off > >> define c as off > >> define d as off > > >> define aa as off > >> define bb as off > >> define cc as off > >> define dd as off > > *************************************************************** > > >> define a as kaprekar / 1000 > >> define b as kaprekar / 100 > >> define c as kaprekar / 10 > >> define d as kaprekar > > >> define aa as a > >> define bb as b - 10 * a > >> define cc as c - 10 * b > >> define dd as d - 10 * c > > >> define a as aa override > >> define b as bb override > >> define c as cc override > >> define d as dd override > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> if b < c > >> define qqq as b > >> define b as c override > >> define c as qqq override > >> define qqq as off > >> end-if > > >> if c < d > >> define qqq as c > >> define c as d override > >> define d as qqq override > >> define qqq as off > >> end-if > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> if b < c > >> define qqq as b > >> define b as c override > >> define c as qqq override > >> define qqq as off > >> end-if > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> define max as a * 1000 + b * 100 + c * 10 + d > >> define min as d * 1000 + c * 100 + b * 10 + a > > >> define kaprekar as max - min override > > >> define max as off > >> define min as off > > >> define a as off > >> define b as off > >> define c as off > >> define d as off > > >> define aa as off > >> define bb as off > >> define cc as off > >> define dd as off > > *************************************************************** > > >> define a as kaprekar / 1000 > >> define b as kaprekar / 100 > >> define c as kaprekar / 10 > >> define d as kaprekar > > >> define aa as a > >> define bb as b - 10 * a > >> define cc as c - 10 * b > >> define dd as d - 10 * c > > >> define a as aa override > >> define b as bb override > >> define c as cc override > >> define d as dd override > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> if b < c > >> define qqq as b > >> define b as c override > >> define c as qqq override > >> define qqq as off > >> end-if > > >> if c < d > >> define qqq as c > >> define c as d override > >> define d as qqq override > >> define qqq as off > >> end-if > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> if b < c > >> define qqq as b > >> define b as c override > >> define c as qqq override > >> define qqq as off > >> end-if > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> define max as a * 1000 + b * 100 + c * 10 + d > >> define min as d * 1000 + c * 100 + b * 10 + a > > >> define kaprekar as max - min override > > >> define max as off > >> define min as off > > >> define a as off > >> define b as off > >> define c as off > >> define d as off > > >> define aa as off > >> define bb as off > >> define cc as off > >> define dd as off > > *************************************************************** > > >> define a as kaprekar / 1000 > >> define b as kaprekar / 100 > >> define c as kaprekar / 10 > >> define d as kaprekar > > >> define aa as a > >> define bb as b - 10 * a > >> define cc as c - 10 * b > >> define dd as d - 10 * c > > >> define a as aa override > >> define b as bb override > >> define c as cc override > >> define d as dd override > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> if b < c > >> define qqq as b > >> define b as c override > >> define c as qqq override > >> define qqq as off > >> end-if > > >> if c < d > >> define qqq as c > >> define c as d override > >> define d as qqq override > >> define qqq as off > >> end-if > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> if b < c > >> define qqq as b > >> define b as c override > >> define c as qqq override > >> define qqq as off > >> end-if > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> define max as a * 1000 + b * 100 + c * 10 + d > >> define min as d * 1000 + c * 100 + b * 10 + a > > >> define kaprekar as max - min override > > >> define max as off > >> define min as off > > >> define a as off > >> define b as off > >> define c as off > >> define d as off > > >> define aa as off > >> define bb as off > >> define cc as off > >> define dd as off > > *************************************************************** > > >> define a as kaprekar / 1000 > >> define b as kaprekar / 100 > >> define c as kaprekar / 10 > >> define d as kaprekar > > >> define aa as a > >> define bb as b - 10 * a > >> define cc as c - 10 * b > >> define dd as d - 10 * c > > >> define a as aa override > >> define b as bb override > >> define c as cc override > >> define d as dd override > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> if b < c > >> define qqq as b > >> define b as c override > >> define c as qqq override > >> define qqq as off > >> end-if > > >> if c < d > >> define qqq as c > >> define c as d override > >> define d as qqq override > >> define qqq as off > >> end-if > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> if b < c > >> define qqq as b > >> define b as c override > >> define c as qqq override > >> define qqq as off > >> end-if > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> define max as a * 1000 + b * 100 + c * 10 + d > >> define min as d * 1000 + c * 100 + b * 10 + a > > >> define kaprekar as max - min override > > >> define max as off > >> define min as off > > >> define a as off > >> define b as off > >> define c as off > >> define d as off > > >> define aa as off > >> define bb as off > >> define cc as off > >> define dd as off > > *************************************************************** > > >> define a as kaprekar / 1000 > >> define b as kaprekar / 100 > >> define c as kaprekar / 10 > >> define d as kaprekar > > >> define aa as a > >> define bb as b - 10 * a > >> define cc as c - 10 * b > >> define dd as d - 10 * c > > >> define a as aa override > >> define b as bb override > >> define c as cc override > >> define d as dd override > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> if b < c > >> define qqq as b > >> define b as c override > >> define c as qqq override > >> define qqq as off > >> end-if > > >> if c < d > >> define qqq as c > >> define c as d override > >> define d as qqq override > >> define qqq as off > >> end-if > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> if b < c > >> define qqq as b > >> define b as c override > >> define c as qqq override > >> define qqq as off > >> end-if > > >> if a < b > >> define qqq as a > >> define a as b override > >> define b as qqq override > >> define qqq as off > >> end-if > > >> define max as a * 1000 + b * 100 + c * 10 + d > >> define min as d * 1000 + c * 100 + b * 10 + a > > >> define kaprekar as max - min override > > >> define max as off > >> define min as off > > >> define a as off > >> define b as off > >> define c as off > >> define d as off > > >> define aa as off > >> define bb as off > >> define cc as off > >> define dd as off > > *************************************************************** > > >> if 6174 is equal to kaprekar > add 1 to correct-counter. > >> else > add 1 to error-counter > >> end-if > > *************************************************************** > > if error-counter not equal to zero > display " QDIR045: FAILED 1 !" upon tv > stop run. > > if correct-counter not equal to 1 > display " QDIR045: FAILED 2 !" upon tv > stop run. > > display " QDIR045: PASSED." upon tv. > stop run. |
From: William M. K. <wm...@ix...> - 2000-10-30 22:00:47
|
CD (Committee Draft) 1.10 of the COBOL revision is available for "down-load" (in PDF format) from: http://www.ncits.org/tc_home/j4htm/cd110all.pdf (If you use a "SAVE TARGET" option, then you can get a reference to it at: http://www.ncits.org/tc_home/j4.htm *** Assuming that all goes "as planned" - this is the last draft before the version that will be sent to ISO (and ANSI) public review. In other words, proposals that are approved at the December J4 meeting WILL be applied to this document - and the "result" will be sent for an FCD (Final Committee Draft) ballot (which is done by "country vote"). (This timing is always subject to "change" - but I think that the DESIRE to do this is so strong, that no matter what problems are found but not fixed by the end of the December meeting - the document will still be sent for "public" review.) FURTHERMORE, it is my impression that J4 and WG4 (not me) have consensus that this "thing" will be judged to "pass" FCD - again, no matter what problems are found. Some changes ARE allowed to occur between FCD and FDIS (Final Draft International Standard) - but they are not supposed to be "substantive technical changes". What is and is not a "substantive technical change" is left up to agreement between the ISO (I think) secretariat and the WG4 convenor - therefore, my GUESS is that anything that MUST happen will be allowed to happen. However, these (CD 1.10 to FCD) really are the last documents where "substantive technical changes" are supposed to be allowed. Therefore, if you find a problem, you might want to "bring it to the attention" of J4 ASAP. OTOH, J4 is also putting NEW comments (not related to current work) in a "early public review" category, so it may be too late already to get much change made. NOTE: The current (draft) agenda for the December meeting and the "outstanding" papers can be retrieved from the J4 web page at: http://people.ne.mediaone.net/doncobol/index.html NOTE WELL: If an issue/change is NOT on that agenda and there is no paper for it - but the "problem" exists in CD 1.10 - you MUST assume that it will not be fixed (certainly not before Public Review - and probably not after) - UNLESS you tell the committees about it via a "document submission". BOTTOM LINE: If you are interested in the "quality" of the upcoming COBOL Standard, I strongly, STRONGLY, suggest that you get a copy of this document and review whatever areas most interest you. You can (should?) send them to J4 (via doncobol <at> mediaone.net) BEFORE Nov 18th (hopefully with recommended "fixes"). In addition, if you are not in the US, please, PLEASE, find out how to submit comments to your "national body" before it goes out to review next Jan/Feb. Please feel free to pass this "note" on to anyone who you think might be interested in it (and might actually follow-up on it). |
From: Tim J. <te...@me...> - 2000-10-11 11:14:57
|
Boris Kortiak wrote: > > are you aware of the test suite available at http://www.nist.gov/itl/div897/ctg/cobol_form.htm for testing compilers? > > _______________________________________________ > Tiny-cobol-users mailing list > Tin...@li... > http://lists.sourceforge.net/mailman/listinfo/tiny-cobol-users |
From: William M. K. <wm...@ix...> - 2000-10-10 21:33:34
|
Free, shareware, or even "low-cost" are not things that you will find for this. All of the products that meet your requirements cost - and most of them cost a LOT. > -----Original Message----- > From: cob...@li... > [mailto:cob...@li...]On Behalf Of > Robert Hansen > Sent: Monday, October 09, 2000 9:25 AM > To: cob...@li... > Subject: [Cobolforgcc-devel] (no subject) > > > Who can help here? > > I'm looking for a free/shareware version of a mainframe COBOL and > ASSEMBLER to run on a pc - like microfocus i. e. - with the > possibility to write/run BATCH and CICS programs accessing VSAM > files, DL/1 and DB2 databases. The EDITOR should be ISPF. > > Regards, Robert Hansen, DK > > _______________________________________________ > Cobolforgcc-devel mailing list > Cob...@li... > http://lists.sourceforge.net/mailman/listinfo/cobolforgcc-devel |
From: Robert H. <rr...@ma...> - 2000-10-09 14:27:06
|
Who can help here? I'm looking for a free/shareware version of a mainframe COBOL and ASSEMBLER to run on a pc - like microfocus i. e. - with the possibility to write/run BATCH and CICS programs accessing VSAM files, DL/1 and DB2 databases. The EDITOR should be ISPF. Regards, Robert Hansen, DK |
From: Tim J. <te...@me...> - 2000-09-20 01:33:29
|
I'm not really sure what you mean by "look behind". In CobolForGCC we are using bison which is an LALR(1) look ahead compiler. It needs considerable help to parse COBOL, due to the fact that COBOL is not LALR(1). You can see the results at http://CobolForGCC.sourceforge.net (browse the CVS source into the gcc/cobol directory; there is a discussion of the help the parser needs in the file cobctok.def). We have the grammar for the COBOL85 nucleus done - the other parts of COBOL do not present any unique problems. There was a long discussion about parsing COBOL under the GNU COBOL project at http://www.lusars.net/maillists/gnu-cobol/threads.html. Do a find on "pars" or "yacc". Learn from our mistakes. I looked at numerous techniques for parsing COBOL. The hacks needed to make BISON/YACC work are only a few hundred lines of code, so I gave away notions of backtracking compilers etc, for reasons which are explained in the mailing list discussion. Basically backtracking makes creating reasonable error messages very difficult. As the GNAT (ADA) compiler crew showed, you can write a fast parser with good error messages by hand as long as writing several hundred thousand lines of extra code does not bother you. But really parsing is a miniscule fraction of building a COBOL compiler. Code generation and optimisation and the runtime libraries are a much larger task. Tim Josling Fishfan1 wrote: > > Hi > > I am in the process of developing lexical and syntax parsers for COBOL. I > have thus far taken a 'look behind' (vs. 'look ahead') approach. I have > heard that the 'look ahead' approach is significantly more effective from a > performance point of view but would still like to know if anyone knows or > has proven that the 'look behind' approach will not work (forgetting about > performance). > > Also, I would be interested in communicating with anyone who has interests > or experience in developing COBOL parsers and/or compilers. > > Best Wishes > > Fish |
From: William M. K. <wm...@ix...> - 2000-09-01 21:38:20
|
FYI -----Original Message----- CD 1.9 is available on the NCITS web site. See, http://www.ncits.org/tc_home/j4.htm Annex B shows as Annex A. This is corrected in the printed version and will be fixed later in the PDF version. Don Schricker; Massachusetts, USA; Don...@me... J4 Chairman MERANT manager of language standards |
From: Tim J. <te...@me...> - 2000-08-24 20:16:22
|
Hi, I am going to NZ/USA/UK over the next two weeks as part of my job, and then going camping for a few days. I expect to be back around 16 September. So I've unsubscribed from the high volume mailing lists for the duration. I will try and pick up my emails but dialup over international lines is a bit hit and miss. Tim Josling |
From: Tim J. <te...@me...> - 2000-08-23 20:25:24
|
Ted, Stop literal really means suspend. Words mean what the committee thinks they mean, I guess. IMHO = In My Humble Opinion ie "I think so but I am not being dogmatic about it". I don't understand the reason for the PIC on display statements. If there is a need for it, and you may have a better idea than me, then put it in. If not then the design principle of "you aint gonna need it" applies and it should not be there IMHO of course. But not a big deal as it is optional. I do not have an accept routine at the moment. Next week maybe we should map out the priorities for the next few months. Regards, Tim Josling "Theodore J. Seward, Jr." wrote: > > Tim, > > Will fix stop literal right away. When I saw "Stop" as part of the > name, I assumed STOP. > > I also missed the word "not" in the phrase "It definitely does not need > pic IMHO.". Did you want that removed? What does "IMHO" mean? > > Is there already an ACCEPT routine? > > The code that I shipped you did not include the new values you add to > usage. I'll add your include file. > > Ted Seward > > Tim Josling wrote: > > > > > Ted, > > > > I found a bug. Stop literal is supposed to suspend the operation > > until the person hits enter or whatever, and then continue with > > the program. At present the routine terminates. So if you could > > change the message and also get ti to return. Thanks, > > > > I will email you my intinerary tomorrow. I will be in LA Tuesday > > from about 2:15pm to 10pm so I will be free to see you any time > > from about 4-8. Maybe we could have a beer after work or a meal > > (my shout), > > > > The cc. is my work email which may be a more reliable way to get > > me while I am away. > > > > Tim Josling |