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.Making or adjusting in the process of process flow diagram, generate simultaneously corresponding comment token and code, and can pass through the corresponding content of comment token access.
The transfer process that realizes by above method can be in the flowchart drawing process generator program control routine simultaneously, have process flow diagram and easily realize, 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 110 " 1@c12c=z ", show that then two affluent-dividings 1.2 of traffic identifier 1 and the stream of 1.3 correspondences all pass through this node, the rest may be inferred.
Please refer to Fig. 1, the corresponding programmed control code that the right edge regions 2 of Fig. 1 converts to for regional 1 process flow diagram.Wherein every row " " symbol is comment token, and " [] " symbol is used for the flag node type, uses if in this example and judges type and while cyclical patterns, is defaulted as type expression, the expression formula of corresponding its next line of every row comment token.
In making the process of process flow diagram, the traffic identifier of node 10 and 11 is defined as 1, decision node 12 has two affluent-dividings, respectively its traffic identifier is defined as 1.2 and 1.3; For node 110, crossed by two affluent-dividings 1.2 and 1.3 that flow 1, it is equivalent to stream 1.Comment token is 01 note and code subsequently in the node 10 direct formation zones 2; Node 11 has two streams to cross, and contain simultaneously stream 1, then be converted to the beginning of loop code piece, cycling condition finds the condition of its initial decision node 111 to generate according to stream information, generate comment token and be 02 note and code subsequently, and its expression formula is generated the note of corresponding comment token 03 and follow-up code; Next process stream 1.2, generate comment token 04 and code subsequently; Node 17 generates comment token 16 and code subsequently; Though node 18 has stream to cross, do not contain the phase homogeneous turbulence, generate comment token 17 and code subsequently; Node 19 generates comment token 18 and code subsequently; Node 110 is crossed by stream 1.2 and 1.3, indicates that two shuntings of node 12 all cross, and stream 1.2 finishes, and generates comment token 04[ifend]; Next process stream 1.3, generate comment token 20 and code subsequently; Node 112 is decision node, generates comment token 21 and code subsequently; Node 113 and 114 generates comment token 22 and 23 codes that reach subsequently successively; Contain stream 1 in the node 110, indicate that two shuntings of node 12 all cross, stream 1.3 finishes, and generates comment token 21[ifend] and 20[elseend] and code subsequently; So far two of node 12 shuntings are disposed, and generate comment token 26 and code subsequently according to node 110; Node 111 is the decision node of circulation, generates comment token 02[whileend]; Node 112 does not have expression formula, does not process.
When process flow diagram changes, can pass through comment token access corresponding contents, in this example, next behavior expression formula of each comment token, each judges the end comment token of a correspondence of control.
The transfer process that realizes by above method can be in the flowchart drawing process generator program control routine simultaneously, have process flow diagram and easily realize, 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.