Integrating a field in one coordinate

I have a function f[x,y] in Fenics. I want to integrate it along y and get g[x] = \int_(-a)^(a) f[x,y] dy, and thereafter evaluate g[x] at desired values of x. Is it possible to do it in Fenics?

A brute-force (maybe naive) way around is to evaluate f[x,y] at various values of x, y and use Gauss quadrature for integration along y. That would require writing my own code. However, I am looking for an existing Fenics functionality to do it.