[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnubol: refmod again (fwd)



Commas are just noise, as are semicolons. They would be quite useful to do things
like separate function or array arguments, but there have no meaning at all other
than to separate *tokens* in some cases.

For example, this is valid:
move 1 to A (I , , , + , 1 2, ) , , , .
And is the same as
move 1 to A(I + 1, 1, 2).

So how do you know an array argument is over. Because you run out of things that
can be one valid argument. What comes next must be the next argument or the ")" or
an error.

In Standard COBOL 4 draft, they allow arithmetic expressions as array arguments;
the same is true for function arguments in Standard COBOL 3 and on.

They have a special rule that an arithmetic expression must not start with "+" or
"-" if it is preceded by stuff that could be an arithmetic expression that this "+"
or "-" could continue.

So

a( i + 1)

There is one array argument in there. It could be two "i" and "+ 1" but for the
above rule.

There is still an ambiguity as far as I can tell.

A( I (2)).

This could be two arguments or one.

"I" and "(2)"
OR "I (2)".

Does it matter if I is an array or not? For example, if I is an array, then I guess
it should be one argument. If not, then it should not be.

But not all contexts require an array reference after the array name (eg in search
verb). This could be ugly to handle. Have I missed something? I intend to email the
committee about this.

Tim Josling

Michael McKernan wrote:

> >>>>> "Jonathon" == J & C Migrations, Pty <migrate@tiac.net>
> >>>>> wrote the following on Wed, 01 Dec 1999 08:16:16 -0500
>
>   Jonathon> At 07:36 AM 12/1/99 -0500, Michael McKernan wrote:
>   >> Interesting and something we'd probably like to adopt.  How do
>   >> we deal with the "comma is noise" problem?
>
>   Jonathon> According to the standard, comma is white space when
>   Jonathon> followed by space.  Don't you just make it the first case
>   Jonathon> in the lexical white space production?
>
>   Jonathon> -------------------------------------------------------------------
> -
>
> That's the problem, Jonathon.  How do we make that ruling compatible
> with general expressons as subscripts?  What separates the expression
> subscripts?
>
> Best regards,
>
> Mike
>
> --
> This message was sent through the gnu-cobol mailing list.  To remove yourself
> from this mailing list, send a message to majordomo@lusars.net with the
> words "unsubscribe gnu-cobol" in the message body.  For more information on
> the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.


--
This message was sent through the gnu-cobol mailing list.  To remove yourself
from this mailing list, send a message to majordomo@lusars.net with the
words "unsubscribe gnu-cobol" in the message body.  For more information on
the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.