Browse Prior Art Database

Method for Encoding Program Structures Compactly for Easy Manipulation

IP.com Disclosure Number: IPCOM000115992D
Original Publication Date: 1995-Jul-01
Included in the Prior Art Database: 2005-Mar-30
Document File: 6 page(s) / 213K

Publishing Venue

IBM

Related People

Mays, RG: AUTHOR [+2]

Abstract

A method for encoding software program structures in a compact form is disclosed. The structural elements of the program are identified and assigned a code. In the case of assignments, calls and conditional statements, the statement is given a unique identifier to tie back to the source code statement. The codes are concatenated into strings, one string for each routine or procedure in the module. The strings can then be manipulated to produce graphs and other analytic results.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 19% of the total text.

Method for Encoding Program Structures Compactly for Easy Manipulation

      A method for encoding software program structures in a compact
form is disclosed.  The structural elements of the program are
identified and assigned a code.  In the case of assignments, calls
and conditional statements, the statement is given a unique
identifier to tie back to the source code statement.  The codes are
concatenated into strings, one string for each routine or procedure
in the module.  The strings can then be manipulated to produce graphs
and other analytic results.

      Software modules are extremely complex and hard to visualize.
In order to display the program structure in an abstract form such as
a graph, it is necessary to extract the structural information from
the source code.  This structural information can then be processed
to produce visual representations such as graphs and calling trees.
The structural elements of a program include such items as its logic
tests, loops, assignment and data transformations, procedure and
function calls, exits and returns.  The non-structural elements
include the data declaration statements, and compiler and
preprocessor directives.

      Normal parsing techniques break out and identify the different
elements of the source code but do not extract and summarize the
purely structural elements of the code.  The resulting parsed table
contains the non-structural elements as well as the structural
elements.  In order to process this table to extract and manipulate
the program's structure, extra processing must be done to bypass the
non-structural elements and to interpret the structural elements
correctly.

      The method disclosed here provides a way of representing the
structural elements of a program that is easy to interpret and
manipulate by another program to display to the user.  The structural
elements that are useful to extract include:
  o  Procedural and function group definitions
  o  Logic branches both simple and complex (IF THEN ELSE, SELECT
WHEN
      OTHERWISE, etc.)
  o  Loops (DO repeat-expression, DO WHILE, DO UNTIL, etc.) including
      the details of the loop branch conditions (the repeat
expression,
      WHILE or UNTIL expression)
  o  LEAVE and ITERATE loop constructs
  o  Other statements that alter the sequence of flow (GOTO, "break"
      in C, SIGNAL in REXX, etc.)
  o  Non-repetitive DO groups of different types (e.g., simple
DO-END,
      the WITH-DO construct in the Pascal language)
  o  The corresponding END statements to Procedural groups, DO loops
      and DO groups.
  o  Call statements: explicit CALLs, implied CALLs and function
      invocations within expressions.
  o  The label targets of GOTOs.

      Each routine or procedure in the program is represented by a
string of symbols and is given a routine or procedure number.  The
string of symbols represents the structural elements of t...