#83 parser: SCREEN items with OCCURS clause should be checked for relative position

GC 2.0
closed
None
4
2016-07-10
2014-06-19
No

Moved from [#82] as this is a different issue.

       >>SOURCE FREE
IDENTIFICATION DIVISION.
PROGRAM-ID. occurs-test.

SCREEN SECTION.
01  screen-var LINE 1.
    03  nums COL 3 PIC 999 OCCURS 3 TIMES.

PROCEDURE DIVISION.
    DISPLAY nums
    .
END PROGRAM occurs-test.

Should not be accepted, as OCCURS in an SCREEN item must have a relative position (in this case COL must be relative, if LINE is part of nums it could be relative, too).

Simon

Related

Bugs: #82
Discussion: Introducing the ASSERT statement

Discussion

  • Edward Hart

    Edward Hart - 2014-06-19

    Attached is a patch for parser.y and a patch for the test suite to detect the error.

     
  • Edward Hart

    Edward Hart - 2014-08-05

    Attached is a correct version of the parser.y patch; I had attached the wrong file to my previous post.

     
  • Simon Sobisch

    Simon Sobisch - 2015-06-03
    • assigned_to: Ron Norman --> Edward Hart
    • Group: unclassified --> GC 2.0
    • Priority: 3 --> 4
     
    Last edit: Simon Sobisch 2015-06-03
  • Edward Hart

    Edward Hart - 2015-06-09

    Fixed in [r601].

     

    Related

    Commit: [r601]

  • Edward Hart

    Edward Hart - 2015-06-09
    • status: accepted --> closed
     
  • Simon Sobisch

    Simon Sobisch - 2016-07-10

    One question here:

    COL PLUS 3 PIC 999 OCCURS 3 TIMES and COL + 3 PIC 999 OCCURS 3 TIMES are valid. Should we allow COL +3 PIC 999 OCCURS 3 TIMES (no seperator space/comma), too?

     
    • Edward Hart

      Edward Hart - 2016-07-10

      I think we should require a space, as COL + 3 acts like an arithmetic expression and so should have a similar syntax. I also think a space makes it clearer that the column position is relative and not absolute.

      I'm not sure what other compilers do; Micro Focus' docs have the same syntax diagram as the standard, but then use "COLUMN+1" in text (the LINE entry says "LINE PLUS 1").

       

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks