is only used in the following contexts:
performVaryingClause
: VARYING performVaryingPhrase performAfter*
;
and
performAfter
: AFTER performVaryingPhrase
;
which in both cases accepts only a literal. It makes no sense semantically to say : PERFORM PARA VARYING 1 BY 1 UNTIL 1=3 or anything like that, and the AFTER semantics is similar, providing an outer loop variable to vary. See for example: https://www.ibm.com/docs/en/cobol-zos/6.2?topic=identifiers-varying-three
The grammar should instead read:
performVaryingPhrase
: (identifier | indexName) performFrom performBy performUntil
;
with the rest unaltered.
performVaryingPhrase : (identifier | literal) performFrom performBy performUntil ;
is only used in the following contexts: performVaryingClause : VARYING performVaryingPhrase performAfter* ; and performAfter : AFTER performVaryingPhrase ;
which in both cases accepts only a literal. It makes no sense semantically to say : PERFORM PARA VARYING 1 BY 1 UNTIL 1=3 or anything like that, and the AFTER semantics is similar, providing an outer loop variable to vary. See for example: https://www.ibm.com/docs/en/cobol-zos/6.2?topic=identifiers-varying-three
The grammar should instead read: performVaryingPhrase : (identifier | indexName) performFrom performBy performUntil ; with the rest unaltered.