Subject: Re: your mail

From: Zheng Gengbin <[email-masked]>
Date: Thu, 26 Sep 1996 09:44:30 +0800 (EAT)

On Tue, 24 Sep 1996, Guansong Zhang wrote:

> Please help. Use our frontend to parse the following program:
> 
> 
>       PROGRAM MAIN
>       REAL X(2:99), Y(100), NO(10)
> !HPF$ PROCESSORS P(4)
> !HPF$ TEMPLATE TX(400),TY(-200:199)
> !HPF$ DISTRIBUTE TX(BLOCK) ONTO P
> !HPF$ DISTRIBUTE TY(BLOCK) ONTO P
> !HPF$ ALIGN X(i) WITH TX(2*i+1)     ! some crazy alignment
> !HPF$ ALIGN Y(i) WITH TY(3*i-50)
> 
>       CALL FOO (X(1:49), Y(1:100:2))
> 
>       PRINT *, (X(i),i=2,99)        ! back to beginning ?
>       END
> 
>       SUBROUTINE FOO(X,Y)
>       REAL X(49), Y(50)
> !HPF$ INHERIT X,Y
> 
>       FORALL (i=1:49) X(i) = X(i) - Y(i) - Y(i+1)
> 
>       END
> 
> ==========================
> 
> ***SYMBOL NODES***
> 
>    id   var   type  attr  next   scope  variable-name
>   11-S  600    2-T    0   ----   ----            FOO
>                                                   LOCAL
>   12-S  505   ----    0   13-S    1-B      PROG_NAME symb_lst=         ----
> prog_hedr=   13-B      PROGRAM_NAME
>   13-S  506   ----    0   ----    1-B            FOO n_in=    2 n_out=    0
> n_io=    0
>                                        in_l=   14-S out_l=   ---- sy_l=   14-S
> p_hdr=   13-B    PROCEDURE_NAME
>   14-S  503   18-T 536870914   15-S   13-B              X local= 603 nxt_in=
>  15-S nxt_out=  ----     VARIABLE_NAME
>   15-S  503   19-T 536870914   18-S   13-B              Y local= 603 nxt_in=
>  ---- nxt_out=  ----     VARIABLE_NAME
>   16-S  503    2-T 536870912   17-S   ----              X local= 601 nxt_in=
>  ---- nxt_out=  ----     VARIABLE_NAME
>   17-S  503    2-T 536870912   18-S   ----              Y local= 601 nxt_in=
>  ---- nxt_out=  ----     VARIABLE_NAME
>   18-S  503    1-T 536870912   ----   13-B              i local= 600 nxt_in=
>  ---- nxt_out=  ----     VARIABLE_NAME
> 
> 
> Why there are two X and two Y? The dummy in the subroutine statement have no
> control parents? It complicated the definition of symbal table, can we fix it?
> 
> Guansong
> 

	I remembered I have mentioned before , a symbol who has a NULL 
scope is a invalid entry . I mean we should remove that entry from the 
symbol table , but in fact we donot . So, the 16-S and 17-S is invalid
symbol entry here, you must ignore them . And I hope you donot modified
the hpf2dep because we now have not enough time to follow up the 
modification.

	Here as semantic checking says , the 
line 10 : CALL FOO (X(1:49), Y(1:100:2))
	X(1:49) is out of subscipts ,because X is defined as 2:99 , the X(1)
is illegal .

Zheng