[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[open-cobol-list] Re: another compilation problem
From: |
Keisuke Nishida |
Subject: |
[open-cobol-list] Re: another compilation problem |
Date: |
Mon Feb 2 18:20:39 2004 |
User-agent: |
Wanderlust/2.10.0 (Venus) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (UnebigoryĆmae) APEL/10.3 Emacs/21.2 (i386-redhat-linux-gnu) MULE/5.0 (SAKAKI) |
At Mon, 2 Feb 2004 17:34:15 -0500 (EST),
David Korn wrote:
>
> Here is an exceprt from a program that doesn't compile.
> ======================prog.cob========================
> 005100 ID DIVISION.
> 005200 PROGRAM-ID. VCAGP210.
> 007000 DATA DIVISION.
> 009000 WORKING-STORAGE SECTION.
> 009348 01 UNIPOTS-ACCUM-TABLE.
> 009349 05 UNIPOTS-A-TABLE OCCURS 2000 TIMES
> 009350 DEPENDING ON WK-EXTRACT-READ-CTR
> 009351 INDEXED BY EXTRACT-INDEX.
> ======================prog.cob========================
> $ cobc -static -std=mvs -C prog.cob
> prog.cob:7: parse error, unexpected DEPENDING, expecting EXTERNAL or GLOBAL
Try this patch.
Keisuke
*** parser.y.~1.543.~ Mon Feb 2 15:05:07 2004
--- parser.y Tue Feb 3 11:16:44 2004
***************
*** 1070,1091 ****
/* OCCURS clause */
occurs_clause:
! OCCURS integer _times
! occurs_keys occurs_indexed
{
! current_field->occurs_min = 1;
! current_field->occurs_max = cb_get_int ($2);
current_field->indexes++;
current_field->flag_occurs = 1;
}
! | OCCURS integer TO integer _times DEPENDING _on reference
! occurs_keys occurs_indexed
{
! current_field->occurs_min = cb_get_int ($2);
! current_field->occurs_max = cb_get_int ($4);
! current_field->occurs_depending = $8;
! current_field->indexes++;
! current_field->flag_occurs = 1;
}
;
--- 1070,1093 ----
/* OCCURS clause */
occurs_clause:
! OCCURS integer occurs_to_integer _times
! occurs_depending occurs_keys occurs_indexed
{
! current_field->occurs_min = $3 ? cb_get_int ($2) : 1;
! current_field->occurs_max = $3 ? cb_get_int ($3) : cb_get_int ($2);
current_field->indexes++;
current_field->flag_occurs = 1;
}
! ;
! occurs_to_integer:
! /* empty */ { $$ = NULL; }
! | TO integer { $$ = $2; }
! ;
!
! occurs_depending:
! | DEPENDING _on reference
{
! current_field->occurs_depending = $3;
}
;