In this work, we propose a framework to automatically generate effective PSO designs by adopting Grammatical Evolution (GE). In the proposed framework, GE searches for adequate structures and parameter values (e.g., acceleration constants, velocity equations and different particles' topology) in order to evolve the PSO design. For this, a highlevel Backus-Naur Form (BNF) grammar was developed, representing the search space of possible PSO designs. In order to verify the performance of the proposed method, we performed experiments using 16 diverse continuous optimization problems, with different levels of difficulty. In the performed experiments, we identified the parameters and components that most affected the PSO performance, as well as identified designs that could be reused across different problems. We also demonstrated that the proposed method generates useful designs which achieved competitive solutions when compared to well succeeded algorithms from the literature.