A program generator for controlling a machine tool based on a machining program, the program generator comprising: a machining process analysis unit for extracting a plurality of machining processes from the machining program, analyzing the machining processes, and generating information regarding the machining processes; a machining process scoring unit for giving each of the plurality of machining processes a score based on the information regarding the machining processes; and a machining sequence determination unit for determining a sequence of the machining processes based on the scores given to the machining processes by the machining process scoring unit , wherein the information regarding the machining processes includes a machining shape to be formed by the machining processes and the likelihood of the machining processes causing deflection and/or thermal deformation, and wherein the machining process scoring unit is configured to give each of the plurality of machining processes the score based on: the machining shape to be formed by the machining process; the likelihood of the machining process causing deflection and/or thermal deformation; and information regarding any one of a previous machining process and a machining process earlier than the previous machining process, the previous machining process and the machining process earlier than the previous machining process being determined by the machining sequence determination unit and being from among the plurality of machining processes. a machining process analysis unit for extracting a plurality of machining processes from the machining program, analyzing the machining processes, and generating information regarding the machining processes; a machining process scoring unit for giving each of the plurality of machining processes a score based on the information regarding the machining processes; and a machining sequence determination unit for determining a sequence of the machining processes based on the scores given to the machining processes by the machining process scoring unit , wherein the information regarding the machining processes includes a machining shape to be formed by the machining processes and the likelihood of the machining processes causing deflection and/or thermal deformation, and wherein the machining process scoring unit is configured to give each of the plurality of machining processes the score based on: the machining shape to be formed by the machining process; the likelihood of the machining process causing deflection and/or thermal deformation; and information regarding any one of a previous machining process and a machining process earlier than the previous machining process, the previous machining process and the machining process earlier than the previous machining process being determined by the machining sequence determination unit and being from among the plurality of machining processes. the machining shape to be formed by the machining process; the likelihood of the machining process causing deflection and/or thermal deformation; and information regarding any one of a previous machining process and a machining process earlier than the previous machining process, the previous machining process and the machining process earlier than the previous machining process being determined by the machining sequence determination unit and being from among the plurality of machining processes. <EOS>