Now, what could be in the control-flow diagrams? Control-flow diagrams show the flow of the program. The nodes of a control-flow diagram may represent a single statement, or a block of a set of statements related to each other. If each node represents a single statement, then it's a detailed control flow graph spanning a lot of space. It's difficult to make the graph to fit in a single screen so some part of the graph should be made available to show on the screen as requested by the user.
In a control-flow graph, a node also may represent a bock of statements. If it's desired to give an overview of the control-flow of the program, the sequence of statements in which there is no branching or no jump, then that sequence may be represented as a single block. This block may be represented in the diagram as a straight line.
Let us take a case in which the input system is a COBOL source code. There are four major divisions in a COBOL program. These are
Identification division
Environment division
Data division
Procedure division
All the working is done in the procedure division. So the control flow diagram contains statements from the procedure division. If it's a detailed diagram it will contain each statement as its node. If it's a compact control-flow diagram, then each node will represent a block. All the successive statements of a category such as MOVE, ADD, ACCEPT, etc. which include neither a jump nor a branching statement are identified as the straight-line code. Other statements like IF-ELSE, PERFORM and GOTO's can be identified as different blocks and also as statements at which a straight-line code ends.
Go To Page: 1 2