Problem with block transformed data

Sorry i’m completely new in stan:
> data

``````>     {
>       int<lower = 0> N;       // number of census
>       int<lower = 0> Y[N];
>       real<lower = 0.000001> E[N];
>       //int ZERO[P];
>       int<lower = 0> P;       //numero delle covariate +1 intercetta
>       vector[P] ZERO;
>       matrix[N,P] X;
>       matrix[P,P] Xinv;
>       matrix<lower = 0, upper = 1>[N, N] W; //matrice di w w_ij se sono vicini
>     }
>
>     parameters
>     {
>       vector[P] beta; 		// array dove ho i paretri del mio modello
>       real<lower=0.00001> sigma2[P];
>       vector[N] phi;
>       real<lower = 0> tau;
>       real<lower = 0, upper = 1> alpha;
>     }
>
>     transformed data{
>       vector[N] zeros;
>       matrix<lower = 0>[N, N] D;
>       {
>         vector[N] W_rowsums;
>         for (i in 1:N) {
>           W_rowsums[i] = sum(W[i, ]);
>         }
>         D = diag_matrix(W_rowsums);
>       }
>       zeros = rep_vector(0, N);
>     }
>
>     model
>     {
>       // Prior:
>         for(i in 1:P)
>         {
>           beta[i] ~ normal (0,sigma2[i]);  // iid sample
>         }
>       phi ~ multi_normal_prec(zeros, tau * (D - alpha * W));
>       alpha ~ uniform(0,1)
>       //		sigma2 ~ inv_gamma(0,0);
>       sigma2 ~ inv_gamma(0.2,0.2);
>        tau ~ gamma(2, 2);
>
>       // Likelihood:
>
>       Y~ poisson(E*exp((X) * beta+phi));
>     }
``````

I get the error :

`````` 23: transformed data{
^
24:   vector[N] zeros;
-------------------------------------------------

PARSER EXPECTED: "parameters"``````

The transformed data block has to come before the parameters block. The transformed data block is executed only once before the MCMC sampling starts. The parameters, transformed parameters, and model blocks are executed every intermediate step of the MCMC sampling.