Summary of the invention
The object of the invention is according to the feature of the stream of the formation of the line in the process flow diagram judgement control procedure in the process flow diagram and cycle control process to be converted to a kind of markup language as required, again markup language is converted to contain and judges code block and loop code piece program control statement, 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 block 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; Then generate a kind of markup language according to above-mentioned beginning and end feature, again markup language is converted to program code.
The transfer process that realizes by above method contains a kind of markup language in middle layer, and conversion logic is more clear, has easy realization, and the node in the process flow diagram 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, use the XML language that serves as a mark.
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 markup language.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 respective markers language that the right edge regions 2 of Fig. 1 converts to for regional 1 flowchart control process, having used following node type: exp is simple type expression, and while is cyclical patterns, and if, elseif and else are different judgement types; Id and con attribute have been used in the node, respectively representation node id and Rule of judgment.
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 is converted to markup language, node 10 is converted to directly that id is 01 flag node in the zone 2, the described flag node that converts to comprises start mark node and end mark node, as<exp〉</exp 〉, node refers to the node in the process flow diagram, flag node is the node in the markup language, and is rear same.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 the flag node of corresponding id=02, and its expression formula is generated the flag node of id=03; Generate the flag node of id=04 according to the Rule of judgment in the tributary 1.1 of decision node; Node 13 generates the flag node of id=05; In the decision node 14>0 judgement generates the flag node of id=06; The flag node of the capable id=07 of node 16 generating codes; Contain stream 1.1 in the node 19, show that this stream finishes the flag node end of text of id=06; In the decision node 14<=0 judgement generates the flag node of id=08; Node 15 converts the flag node of id=09 to; Though node 18 contains two streams, only contain a tributary 1.1.2 of stream 1.1, therefore generate the flag node of id=10; Contain stream 1.1 in the node 19, indicate this tributary end, the flag node end of text of id=08; Contain stream 1 in the node 110, three shuntings of sign node 12 all cross, indicate that stream 1.1 finishes the flag node end of text of id=04; Next process stream 1.2, generate the flag node of id=12; Node 17 generates the flag node of id=13; Though node 18 has stream to cross, do not contain the phase homogeneous turbulence, generate the flag node of id=14; Same node 19 generates the flag node of id=15; Three shuntings of sign node 12 all cross, indicate that stream 1.1 finishes the flag node end of text of id=12; Next process stream 1.3, generate the flag node of id=16; Node 112 is decision node, generates the flag node of id=17; Node 113 and 114 generates the flag node of id=18 and id=19 successively; Contain stream 1 in the node 110, three shuntings of sign node 12 all cross, indicate that stream 1.3 finishes; So far three of node 12 shuntings are disposed; Node 112 does not have expression formula, does not process.
Please refer to Fig. 2, order reads the content of above-mentioned markup language, does corresponding conversion processing according to different node types and can be translated into a kind of process control language.
The transfer process that realizes by above method contains a kind of markup language in middle layer, and conversion logic is more clear, has easy realization, and the node in the process flow diagram such as can share at advantage, the simultaneously corresponding clear easy care of process flow diagram.
Any markup language, the markup language that comprises the markup language of standard, self-defining markup language, realizes by database table or form document, as long as can all can realize said method by its mark access mark node.
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.