The Rigi C++ Parser

This document explains the usage of cs2rsf, the Rigi C++ parser. The Rigi C++ parser is designed to extract entities and the relationships between entities from files of C++ source code. Currently the entities that the parser extracts are namespaces, classes and their members, functions, datatypes, and variables. The relationships that the parser extracts are containing relationships for namespaces, inheritance for classes, function calls between function entities, data accesses between functions and data structure entities, and variable references between functions and variables. The parser also extracts other attributes of the entities, such as their type (either Function or Data) and the line number in the source code file that they were extracted from.

cs2rsf reads VisualAge for C++ 4.0 project files and writes the entities, relationships, and attributes it extracts as RSF (Rigi Standard Format) 4-tuples to standard output. As a side effect, the project will be compiled and linked.

  1. The C++ Domain
  2. cs2rsf Command Line Parameters
  3. Usage Examples

The C++ Domain

Node Types

Besides the standard Rigi node types (Unknown and Collapse), the C++ domain contains the following node types:

Node Names

Node names will be built from the name of an artifact (variable, ...), the location where it is defined, and a scope number, if the artifact is defined within a namespace, class, or function:

Arc Types

Besides the standard Rigi node types (level, composite, and multiarc), the C++ domain contains the following arc types. If you read the elements of an arc in the order element 2, element 1, element 3, then you will have an English sentence that explains the relation:

Attributes

cs2rsf emits the following attributes for nodes:

cs2rsf Command Line Parameters

cs2rsf expects the name of the project file for the project to parse as its only command line parameter. A short usage summary will be displayed if the cs2rsf is invoked with to few or to many parameters.

Usage Examples

Using cs2rsf to generate Rigiedit views

To generate a Rigi view for a project, first invoke cs2rsf, then run sortrsf to remove duplicate tuples, combine multiple arcs with the same source and destination into arcs of type multiarc and sort the rsf file for faster processing:

cs2rsf myproject.icc | sortrsf -m > myproject.rsf

Now you can load myproject.rsf.sorted into rigiedit

Using cs2rsf to htmlize source and generate Rigiedit views

Use cs2rsf to parse your C++ program and sortrsf with the -4 option to remove duplicate tuples from the RSF file:

cs2rsf myproject.icc | sortrsf -4 > temp.rsf

Use htmlrsf to htmlize the source and create nodeurl attributes:

htmlrsf -pxa extends,calls,references,tagged -b type < temp.rsf > myproject.rsf

Now you can load myproject.rsf into rigiedit. If you double-click on a node, netscape will be started to display the source code for the node.

This manual page is maintained by Johannes Martin