A generating function approach to branching random walks