Re: function-identifier-variable

"Prof Abimbola Olowofoyeku" <[email protected]> Mon, 28 Mar 2016 20:32:27 +0100
Newsgroups gmane.comp.compilers.gpc
Organization ChiefSoft
Message-ID <[email protected]>
On 28 Mar 2016 at 15:00, Paul Isaacs wrote:

> Hello;
> 
> program test;
> 
> {
>      productions:
> 
>      assignment-statement                    :  contains expression
>      expression                                    :  contains 
> simple-expression
>      simple-expression                            :  eventually works
> down to primary
>      primary                                    : contains 
> variable-access
>      variable-access                                :  contains 
> function-identifier-variable
>      function-identifier-variable               =  pointer-function '^'
>      pointer-function                                 :   contains 
> entire-function-access
>      entire-function-access                     = function-designator
>      function-designator                          =  function-name [ 
> actual-parameter-list ]
>      function-name                                    :  contains
>      identifier
> }
> 
> {
>   compiled with:
> 
> $PASCAL/local/bin/gpc --extended-pascal test.pas
> test.pas: In main program:
> test.pas:11: error: invalid type of argument of `^'
> }
> 
> function y : boolean;
> begin
>   y := false;
> end;
> 
> var
>   x : boolean;
> begin
>   x := y^;                  { isn't " y" a function-identifier-variable
>   ? }
> end.
> 
> Where is the error in thinking?

I don't know much about EP - but it seems to me that what you are 
trying to do (dereferencing something that is not declared as a 
pointer) should be illegal.

"x := y" should be the call.

Best regards, The Chief
--------
Prof. Abimbola A. Olowofoyeku (The African Chief) 
web:  http://www.greatchief.plus.com/


_______________________________________________
Gpc mailing list
[email protected]
https://www.g-n-u.de/mailman/listinfo/gpc