Source Flowchart Viewer

Overview

Although program code is usually written in textual form, it possesses its own internal structure. While looking at the code contained within a function, it is sometimes hard to recognize the building blocks easily. The DAC Flowchart engine is capable of rapid source file analysis and display in Flowchart window of the graphical representation of currently edited function.

Two types of flowchart are common: structured flowcharts and non-structured flowcharts.

In the various implementations of flowcharts, they are usually displayed so that the entire source code is partitioned into fragments and displayed inside the drawn blocks. The DAC Flowchart is based on a different philosophy, to be explained from here on.

Flowchart engine is so fast that Flowchart can at all times be displayed as the alternative view of the currently edited source code. Since Flowchart can be seen as the alternative view of the source code, these two views are completely synchronized: while moving through Flowchart, the Editor view always reflects the current position. The same goes for editing – in this case, Flowchart reflects the corresponding insertion point position in the Editor.

When Editor recognizes that the source code is about to be changed, Flowchart becomes grayed, and is not updated until it receives scope. This allows a fast response to editing. Also, flowcharts drawn from incomplete code would not make much sense. When code change is completed, a single click on Flowchart window will make the grey shades disappear – Flowchart is updated once again. The close connection between Editor and Flowchart provides a possible solution to a problem present in other flowcharting environments. In other environments, where the entire code must be displayed inside Flowchart, charts usually become too big – so big that they become unusable. The part of Flowchart being displayed on the screen is so small that the structure cannot be seen.

Instead of this, DAC does not display the entire code in Flowcharts. Since flowcharts can always be synchronized with Editor, it is enough to display the code structure and comments from the source inside Flowchart. The real code can always be edited the way it usually is—inside of the Editor.

Displaying only comments inside Flowchart has an additional advantage over the other modes of Flowchart display. When the details are omitted, the code logic can be seen more easily.

The amount of text displayed from comments can be adjusted. All Flowchart building blocks are based on the code block. Modifying the code block settings affects practically the entire flowchart. This means that flowchart tweaking should customarily start from the dialog box that configures code blocks.

Another strategy DAC uses with enormously large flowcharts is that of expansion levels. The maximum depth of displaying the enclosed blocks can always be specified and easily changed.

If all characters from the comments were displayed, this would often fail to give sensible results. Many comments contain characters used only to improve comments visibility or for drawing borders. This is why the DAC Flowchart engine will try to recognize and ignore such characters. But, regardless of how smart software can be, humans are smarter. If a fancy bordering scheme for comments is not recognized by the algorithm, you should refrain from using such a scheme if displaying these comments inside Flowchart diagrams is required.

Flowchart engine relies on the Symbol database to identify the code conditionally excluded from compilation using preprocessor directives (#if, and so on). If preprocessor directives have been changed in the Editor, the database information should be updated (by choosing, for example, Start > Build Project) to obtain an accurate Flowchart.

Flowchart show little marks on nodes that contain calling from another functions. The color may be changed in Options > Editor.

Showing and Hiding Flowchart

To show a flowchart of the function in which the insertion point is positioned, select the View > Show Flowchart menu command or click the Show Flowchart toolbar button. Selecting the same menu command or toolbar button will hide Flowchart. Whether a Flowchart will be displayed as Structured or Non-Structured, depends on the initial view parameter of the Options > Flowchart / General dialog box. To switch between these two types, click the Structured Flowchart or Non-Structured Flowchart toolbar button, or select the appropriate command from the Graph menu.

You can use the Navigation window to navigate quickly through parts of the Graph. It displays a reduced picture of the entire graph, and clicking any point on the Navigation window positions the view in the main window of the Graph around that particular point.

Changing Flowchart Position

Flowchart can be positioned right, left, above or below the Editor view. To change Flowchart position click the Swap or Rotate toolbar button. Change of position can also be accomplished by setting the initial Flowchart position parameter in the Options > Flowchart / General dialog box.

Inserting Language Constructs

Using DAC, you can quickly and easily insert language constructions (if, else, do, while, for, switch, and case) into Flowchart, and simultaneously into the code of the edited function.

DAC offers two ways of performing this operation:

Inserting a new block in front of or behind the selected block. This can be used, for example, when designing functions.
Encompassing one or more blocks by a new construction. Let us suppose that you have, while analyzing Flowchart of your function, realized that a certain group of blocks should be executed only under a certain condition. Instead of the tedious switching to the Editor and subsequent typing, you can simply select the appropriate blocks and with a single click subsume them under a conditional block.

When constructions are being inserted, attention is paid to logical code indentation.

Here is how you can insert an if construction behind a particular block:

Position the mouse on the lower border of the block you have selected. You will know that the mouse is on the block border when the insertion point is replaced by a vertical arrow. Select the lower border of the block of your choice and it will turn blue as in figure . Click the if toolbar button or select the Edit > Insert Construct / If menu option. The result of this operation is an inserted if block behind the selected block, as in figure .

Flowchart: Inserting a construction behind the selected block

Inserting a construction behind the selected block

Flowchart: Result of the if construction insertion operation

Result of the if construction insertion operation

Inserting a construction above the selected block is carried out analogously.

You can encompass selected blocks by the if conditional block in the following way:
Select the block from which you want the new conditional block to begin, as in following figure:

Flowchart: Selected block from which the new conditional block will begin

Selected block from which the new conditional block will begin

Click the if Toolbar button if Toolbar button, then select the end block of the new conditional block. In the example, this is the third code block. The result is a new conditional block which encompasses three selected code blocks. You may notice (on the next figure) that the code has been correctly indented after the new construction was inserted:

In the same way you can enter any of the offered language constructions. DAC will ensure that you do not make any mistakes - for example, entering a case construction if a block within the switch expression has not been selected is not allowed. However, you may happen to enter a construction you did not want. In this case, carry out the Undo command in Edit menu and you will have removed the error in a single move.

Scrolling and Printing

If Flowchart size exceeds window size, you can see the part of Flowchart which you are interested in using the scroll-bars or the standard key combinations. Likewise, Flowchart window supports wheel scrolling. If you hold down the Ctrl key and wheel scroll simultaneously, the Fit to Window, that is Normal View operation will be performed. Holding down the Shift key and wheel scrolling changes the global Flowchart expansion level.

You can print a Flowchart (the File > Print menu option), copy it to the Clipboard (Edit >Copy) or save it to a WMF file (File > Save As).


Copyright 1993-2017, RistanCASE GmbH