Generate code for functions and variables