From: David E. <de...@us...> - 2009-02-28 05:02:41
|
I do not think 'EXIT PARAGRAPH' is part of COBOL-85 standard. The COBOL 200x standard states as follows. EXIT [ PROGRAM | PARAGRAPH | SECTION | METHOD | FUNCTION | PERFORM ]. So it is probably a MF extention to the COBOL-85 standard. However, it seems to be functionally equivalent. So I have updated SF CVS (version 0.64.7) with your changes. Carlucio Lopes wrote: > Comando : EXIT PARAGRAPH > Para adquar o padrao STD85 MF solicito a sequinte alteracao: > > arquivo htcobol.y > de: > %token ORGANIZATION OTHER OUTPUT OVERFLOW_TOK > %token PADDING PAGE PAGE_COUNTER PERFORM PF PH PICTURE PLUS POINTER POSITION > %token POSITIVE PREVIOUS PROCEDURE PROCEED PROGRAM PROGRAM_ID > ... > .. > /* EXIT statement */ > exit_statement: > EXIT { gen_exit(0); } > | EXIT PROGRAM { gen_exit(1); } > ; > > para: > %token ORGANIZATION OTHER OUTPUT OVERFLOW_TOK > %token PADDING PAGE PAGE_COUNTER PARAGRAPH PERFORM PF PH PICTURE PLUS POINTER POSITION > %token POSITIVE PREVIOUS PROCEDURE PROCEED PROGRAM PROGRAM_ID > ... > ... > /* EXIT statement */ > exit_statement: > EXIT { gen_exit(0); } > | EXIT PARAGRAPH { gen_exit(0); } > | EXIT PROGRAM { gen_exit(1); } > ; > > arquivo reswords.c : > de: > {"PAGE-COUNTER", PAGE_COUNTER, 0, TCOB_KW_STD}, > {"PERFORM", PERFORM, 0, TCOB_KW_STD}, > {"PF", PF, 0, TCOB_KW_STD}, > > para: > {"PAGE-COUNTER", PAGE_COUNTER, 0, TCOB_KW_STD}, > {"PARAGRAPH", PARAGRAPH, 0, TCOB_KW_STD85}, > {"PERFORM", PERFORM, 0, TCOB_KW_STD}, > {"PF", PF, 0, TCOB_KW_STD}, > > > veja programa abaixo: > identification division. > program-id. paragraph01. > author. Carlucio Lopes. > environment division. > configuration section. > special-names. > decimal-point is comma. > data division. > working-storage section. > 77 wsn-parag pic 9(01). > 88 wsc-parag-ok value 1 2 3. > procedure division. > move 1 to wsn-parag > perform until wsn-parag = zero > evaluate wsn-parag > when 01 perform 000-parag > when 02 perform 010-parag > when 03 perform 020-parag > when other move zero to wsn-parag > end-evaluate > end-perform > stop run. > 000-parag. > display "000-parag " at 0910 > accept wsn-parag at 1010 > if not wsc-parag-ok > display "Sai do programa" at 1110 stop " " > exit paragraph > end-if > display "000-parag sai " at 1210. > 010-parag. > display "010-parag " at 0910 > accept wsn-parag at 1010 > if not wsc-parag-ok > display "Sai do programa" at 1110 stop " " > exit paragraph > end-if > display "010-parag sai " at 1210. > 020-parag. > display "020-parag " at 0910 > accept wsn-parag at 1010 > if not wsc-parag-ok > display "Sai do programa" at 1110 stop " " > exit paragraph > end-if > display "020-parag sai " at 1210. > > > carlucio@carlinux:~$ htcobol -x -F -P paragraph01.cob > paragraph01.cob: 28: error: syntax error, on or before 'paragraph' > paragraph01.cob: 28: error: unknown or wrong statement, on or before > 'paragraph' > paragraph01.cob: 28: error: unknown or wrong statement, on or before > 'paragraph' > paragraph01.cob: 29: error: unknown or wrong statement, on or before > 'end-if' > paragraph01.cob: 35: error: syntax error, on or before 'paragraph' > paragraph01.cob: 35: error: unknown or wrong statement, on or before > 'paragraph' > paragraph01.cob: 35: error: unknown or wrong statement, on or before > 'paragraph' > paragraph01.cob: 36: error: unknown or wrong statement, on or before > 'end-if' > paragraph01.cob: 42: error: syntax error, on or before 'paragraph' > paragraph01.cob: 42: error: unknown or wrong statement, on or before > 'paragraph' > paragraph01.cob: 42: error: unknown or wrong statement, on or before > 'paragraph' > paragraph01.cob: 43: error: unknown or wrong statement, on or before > 'end-if' > carlucio@carlinux:~$ > > com a alteracao: > carlucio@carlinux:~$ htcobol -x -F -P paragraph01.cob > > compilou ok. > > |