A code for calculating spectral line shapes in tokamaks and assisting in experimental data interpretation