Re: strict productions

Bastiaan Veelo <[email protected]> Wed, 15 Feb 2017 09:06:45 +0100
Newsgroups gmane.comp.compilers.gpc
Message-ID <[email protected]>
> On 15 Feb 2017, at 08:10, Paul Isaacs <[email protected]> wrote:
> 
> x( a,b,c)[ 6,7,8 ] being valid and it is not.


I think it is. This compiles and runs:

program array_return(output);

type i5 = integer value 5;
     arr_type = array[1..10, 1..10, 1..10] of i5;

var arr : arr_type;
    a, b, c : integer;

function x(a, b, c : integer) : arr_type;
begin
    x := arr;
end;

begin
    a := 2;
    b := 3;
    c := 4;
    writeln(x(a, b, c)[6, 7, 8]);   {5}
end.

_______________________________________________
Gpc mailing list
[email protected]
https://www.g-n-u.de/mailman/listinfo/gpc
signature.asc (application/pgp-signature, 842 B)
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJYpAwWAAoJEKv6vZcpz/qNXDQP/1mJKsBvb0OFz3YJ6wFZuFIl
7v5kegdwKbB87hhURp/x6dz0qz+wgT7tn+9LDPVVUiaTEiClg0aiV0b6ukVW8hQe
5DA3VuW7ZHiJAd18/x1NLb+DFG4b3dPM9Yb5H0vFY299hvwCCGs273nnE5ZV/psj
CMuAoQLX6RZ4GqHeymWNdotN/j4WhIvvSTZQzy5VXrtOfTa/OZYtDa5qzd+tOaU+
JCwfc/9cuDR8fcEVbBQFd+WougSBcPHaxpTrXEn9uBA6XI0deydUg+eeRSnX6ohB
2R7RrWVsEZQAtMh81y18M//rvkyomFYBfwdXvGMEAKKBv7KzsLUDwMPUtADlmhZK
vbb1sh5wmJqn2yIPHPwhfycyXUAK2XFii3ueKZ0ktsxge/nd7yJt1SEJ9Y30iRyz
YkXmSf3zEPmYXM1K4HW/NQ4jM2OVptslBIoBmzcsGzG5YFeo878WAA02ngFHNIr7
dNnS/uR6TjrXQgsYLJUnZZJCIU3WK0pD5uRlejFeOMmRm1AJoBNTSz6TWMYy19O1
l3i7bLTpRZTcZhwnmn3yIiInVYJVMtI8UE2Bf/4F2eZTm1z61xvIiA34Ejowaeex
rSr03KAWMI8aIhTr3B4PJXyhvVTjFoggogJhM1h8Y2ce5zVsOUpqNWWIx/OJtX/b
5OhewDD3jevxhkKtyFpj
=ClwQ
-----END PGP SIGNATURE-----