Generates method-specific code.