Patent ID: 8671386
Filing Date: 2014-03-11
Classification: G06F

Abstract:
1. A program generating apparatus including a processor and a memory, comprising: a block diagram storing unit configured to store a block diagram including an input block element, a calculation block element, an output block element, data lines indicating data flows between the input block element, the calculation block element, and the output block element, and a branch point that branches at least one of the data lines; a block diagram dividing unit configured to divide the block diagram into an input side piece and one or more output side pieces at the branch point and connect a branch point block element to one end of each of data lines which have been connected to the branch point in the input side piece and the one or more output side pieces to generate a plurality of block diagram pieces, wherein each of the plurality of block diagram pieces includes the input side piece or one of the one or more output side pieces; a program instruction generator configured to generate a plurality of program instructions, respectively corresponding to the plurality of block diagram pieces, to perform processing on the plurality of block diagram pieces; an execution sequence determining unit configured to determine an execution sequence of the plurality of program instructions so that a first program instruction of a first block diagram piece including the input side piece is executed before one or more second program instructions of one or more second block diagram pieces including the one or more output side pieces; a structural information generator configured to generate structural information for each of the plurality of block diagram pieces; and a program generator configured to arrange the plurality of program instructions according to the execution sequence and generate a program including each of the plurality of program instructions as arranged, wherein the program generator sets comment lines respectively corresponding to the plurality of program instructions, and writes the structural information of each of the plurality of block diagram pieces into the comment lines corresponding thereto, respectively; wherein the structural information generator generates the structural information of each of the plurality of block diagram pieces so that a block element at an end of each of the plurality of block diagram pieces is assigned to a child node of a root node of a tree structure, the block element being one of the input block element, the calculation block element, the output block element, or the branch point block element, and a first block element to be processed before a second block element assigned to a parent node different from the root node is assigned to a child node of the parent node, the first block element and the second block element each being one of the input block element, the calculation block element, the output block element, or the branch point block element.