add code generation function to walley.wy