Developer Tools‎ > ‎


PasViz is a Pascal/Lazarus Unit Dependency Visualizer, based on some code from USGParse (Original source code attached below) and using GraphViz.  (It is not a class hierarchy visualizer). 

Simple Project Selection GUI:
Simple PasViz GUI
Windows GUI input screen

Sample Output:
Sample Output

Windows GUI Output:

Here are some other sample output graphics from the program, they are probably better viewed after downloading locally, as most of them are wider than the display:


Current Status: Development/Alpha Testing

Current features:
  • Tested on Mac OS X 10.7 and Windows.  (Should run on other Unix based Operating systems, including Linux, etc., where GraphViz is available).
  • Parse LPR or PAS main program file and sub-units.
  • Generate an output file in DOT format, which is passed to GraphViz DOT (or any other GraphViz Engine), and can be used to output to PNG, SVG, etc.
  • Ablity to use built-in Display functionality, or call external viewer. 
  • Differentiates between Interface and Implementation Units
Current styling (Used in Sample graphs):
  • Rectangle = Main program
  • Ellipsis = Unit
    • Black = Normal
    • Red = Unable to locate Unit file for processing (i.e. outside of current path)
  • Lines = Unit dependencies
    • Solid = Used from Implementation
    • Dotted = Used from Interface
Legacy Code Clean-up (Completed):
  • All required units from USGParse compile in FreePascal 2.4.4 on Intel x86-32
    • Fix crasher issues for DropParsers and related routines on MacOS X
  • Converted all non-standard components used by USGParse into standard LCL components.
  • Converted most file handling routines to Unicode clean routines.
  • Miscellaneous Delphi to FPC/Lazarus conversions.
  • Changed case handling to avoid issues where units are referenced with a different case than the actual file name case, etc.
  • {$IFDEF}ed all Windows specific code in legacy code not to compile on other platforms, and implemented work-arounds for required functionality.
Legacy Code clean-up (To-do):
  • Convert all i386 ASM routines in legacy units to pure cross-platform Pascal code
  • Convert all typecasting to safer routines. (In Progress).
  • Verify full Unicode compliance on all platforms.
Planned Features:
  • Allow .pp or .pas for units. (Currently .pas only)
  • Skip processing of duplicate units
  • GUI
  • Skip processing of duplicate dependency relationships.
  • Show Forms, Frames, and Data Modules with different styling
  • Customizable styles
  • Parsing of LPI files in order to locate units outside the current path for processing.
  • Ignore list/option for system units.
  • Handling of packages (lpk)
  • Setting of GraphViz path via config file/dialog
CLI Usage:
  • PasVizCLI input_file.lp
Source Code License/Status:
  • USGParse
    • The license of the [very old] original USGParse source-code is unclear, though most likely public domain. 
      • (The author has been contacted for clarification)
    • The USGParse GUI is mostly working under FPC/Lazarus at this point, however rehabilitating this GUI is beyond the scope of this project.
    • Only the [modified] PasParser and TextUtils units are used by PasViz.
  • PasViz
    • The PasViz and libDot libraries, as well as the CLI and GUI programs will be released under the FPC Modified BSD licence.
Developer Notes:
  • In the current state, the PasVizCLI program takes for input a .lpr or .pas file that is the main program source code for a project, and outputs a file called output.gv.
  • The output.gv file can be used as input to GraphViz DOT (or another engine).  The output can be specified as PNG, SVG, etc.  (This can also be opened with ZGRViewer).  DOT is not currently provided in this package, and must be downloaded/installed separately. 
  • Currently the PasVizCLI itself does not execute the DOT binary, however a batch file/shell script (also called PasVizCLI) is provided which will run the run PasVizCLI binary itself, and dot.exe (And a viewer for the PNG output) as well.  The shell script configuration file should be edited to point to the location of DOT on your system.
  • Legacy units can be found at the original developer's page here.
Unit Descriptions:
  • PasParse - Legacy USGParse Unit which has object types for parsing Pascal source code files.
  • TextUtilsLite - Legacy USGParse Unit which has miscellaneous text processing routines used by PasParse. (Lite version has most of the non-relevent code commented out).
  • ComUtil.pas Legacy USGParse Unit which implements several list types, and some memory management routines.
  • PasVizCLI - Main project file for command-line version of PasViz.
  • PasViz - Main project file for GUI version of PasViz.
  • libPasViz - Contains main PasViz routines and logic used by PasViz and PasVizGUI.
  • libDOT - Library to output DOT .gv file.
  • frm* - These are the units for the GUI forms.
How to Get PasViz:
  • For binary (Pre-compiled Installable) versions, you may use the download links below.
  • For the source code, please use our PasViz repository at GitHub to ensure you have the most up-to-date version.

Site Administrator,
Dec 29, 2011, 6:26 AM
Site Administrator,
Dec 30, 2011, 7:13 AM
Site Administrator,
Jan 11, 2012, 1:19 AM
Site Administrator,
Dec 30, 2011, 7:18 AM
Site Administrator,
Dec 30, 2011, 7:37 AM
Site Administrator,
Dec 28, 2011, 6:30 PM