Summary of the invention
The object of the invention is the stream that the judgement control procedure in the process flow diagram and cycle control process form according to line is converted to as required judgement code block and the loop code piece of specific program language, described stream is the logic flow that is connected to form through line by one or more nodes in the process flow diagram, be divided into a plurality of streams by decision node therebetween, described judgement code is that judging such as if of using in the program code processed code block, and described loop code piece is the loop code piece such as the while circulation that uses in the program code.
Determine that according to the decision node information in the process flow diagram one judges the beginning of code block, determine the end of this judgement code block according to the joint information of this decision node stream out.If contain identical flow identification information in two streams that cross in the process flow diagram, then determine the beginning of loop code piece by the nodal information that crosses, determine the end of loop code piece according to the decision node information of corresponding stream in the process flow diagram.
The transfer process that realizes by above method has easy realization, and node such as can share at advantage, the simultaneously corresponding clear easy care of process flow diagram.
Embodiment
Below realize preferred example of the present invention by example explanation.
Please refer to Fig. 1, left area 1 is a process flow diagram among Fig. 1, and zone, the right 2 is corresponding with it programmed control code.Comprise traffic identifier and expression formula information in each node in the zone 1, wherein the part of " " symbol front end is the traffic identifier symbol, and " " symbol rear end is expression formula, can be with the place that certain can be read and write that is kept at of traffic identifier recessiveness in the practice process; Such as " 1@a=x in the start node 10; ", namely the traffic identifier at this node place is 1, expression formula is a=x; And in the node 19 " 1.1+1.2@c12c=z ", show that then two affluent-dividing 1.1.1,1.1.2 of traffic identifier 1.1 and the stream of 1.2 correspondences all pass through this node, and traffic identifier 1.1.1 shows that it connects from traffic identifier 1.1, and traffic identifier 1.1 connects from traffic identifier 1, by that analogy.
Please refer to Fig. 1, the corresponding program code that the right edge regions 2 of Fig. 1 converts to for regional 1 process flow diagram.Wherein every row ": " symbol the first section is the line identifier in order to explanation, and ": " symbol back part is corresponding program code.
In the process of making process flow diagram, the traffic identifier of node 10 and 11 is defined as 1, and decision node 12 has three affluent-dividings, respectively its traffic identifier is defined as 1.1,1.2,1.3, decision node 14 has two affluent-dividings, respectively its traffic identifier is defined as 1.1.1 and 1.1.2; For node 19,1.1.1,1.1.2 and 1.2 cross by stream, and wherein flowing 1.1.1 and 1.1.2 is two affluent-dividings of node 14, and namely all affluent-dividings of node 14 all cross, and then its corresponding stream is 1.1, so node 19 contains the information of 1.1 and 1.2 two streams; For node 110, crossed by three affluent-dividings 1.1,1.2 and 1.3 that flow 1, it is equivalent to stream 1.
When process flow diagram was converted to the programmed control code, node 10 directly was converted to the code of code line 01 in the zone 2; Node 11 has two streams to cross, and contains simultaneously stream 1, then is converted to the beginning of loop code piece, and cycling condition finds the condition of its initial decision node 111 to generate according to stream information, code behavior 02, and its expression formula generated to code line 03; Rule of judgment generating code capable 04 according to the tributary 1.1 of decision node; Node 13 generating codes capable 05; In the decision node 14>0 judgement generating code capable 06; Node 16 generating codes capable 07; Contain stream 1.1 in the node 19, show that this stream finishes generating code capable 08; In the decision node 14<=0 judgement generating code capable 09; Node 15 converts code line 10 to; Though node 18 contains two streams, only contain a tributary 1.1.2 of stream 1.1, so generating code capable 11; Contain stream 1.1 in the node 19, indicate this tributary end, generating code capable 12 and code line 13; Contain stream 1 in the node 110, three shuntings of sign node 12 all cross, indicate that stream 1.1 finishes generating code capable 14; Next process stream 1.2, generating code capable 15; Node 17 generating codes capable 16; Though node 18 has stream to cross, do not contain the phase homogeneous turbulence, generating code capable 17; Same node 19 generating codes capable 18; Three shuntings of sign node 12 all cross, indicate that stream 1.1 finishes generating code capable 19; Next process stream 1.3, generating code capable 20; Node 112 is decision node, generating code capable 21; Node 113 and 114 is generating code capable 22 and 23 successively; Contain stream 1 in the node 110, three shuntings of sign node 12 all cross, indicate that stream 1.3 finishes generating code capable 24 and 25; So far three of node 12 shuntings are disposed, according to node 110 generating codes capable 26; Node 111 is the decision node of circulation, generating code; Node 112 does not have expression formula, does not process.
The transfer process that realizes by above method has easy realization, and node such as can share at advantage, the simultaneously corresponding clear easy care of process flow diagram.
The above embodiment only is the better embodiment of the present invention; and unrestricted claim of the present invention; the structural change of the modification that any utilization instructions related content of the present invention is done and equivalence and enforcement and the corresponding inspection method of carrying out all should be included within the scope of patent protection of the present invention.