Larsen Source Mapper

E-Mail: leifel@online.no
Updated September 21, 1998


Free! Source Mapper has now turned to be freeware! There are several reasons for this. The first I would like to mention is the fact that no one has registered it! So you people hopefully get what you wants, - FREEWARE! The other reason is that I've bought IBM Visual Age C++ v.3.0 for OS/2. And guess what! - I am really impressed about this product. It has built in support for most of the things that Source Mapper can do, plus a lot more...

Click here to see an example of a map produced by Source Mapper.
(smexample.txt - Aprox. 32 kByte)

Click here to see the history list of Source Mapper.
(smhistory.txt - Aprox. 4 kByte)

Click here to download Source Mapper for OS/2 Warp and DOS.
(sm099e.zip - Aprox. 280 kByte)


About Source Mapper

With SM you can make a useful (human readable) map of your C-style source codes. You can generate a map of a single sourcefile, or you can have SM generate a map of a huge project that consists of many source files.

The map is espesially useful when you need to document the source(s) of your project. I've also found it helpful when digging into sources written by others.

The produced map is divided into sections. The main sections are:

  1. Total information and statistics
    This includes some statistical information about all the sources of your project. How many lines are empty? How many lines are real code? How many functions and comments are there? Etc. You will also find a sorted list of all source files in the map, with easy-to-find line number references of where each of the sources begin listening in the map. Each line in the map will have two types of line numbering. Local (offset line number within the given module) and global. Local line numbers are referenced with "L-nnn" while global line numbers are referenced with "G-nnn".

  2. Function register
    Sorted list of all functions in your project. Each function in the register will show you both the local and the global line number to let you find the source of the functions quickly.

  3. List of function calls
    With information about by which function each of the functions in your project is called. This section is not implemented to the map by default. If you want it you must manually enable it using the ilf[+] option.

  4. Identifier list
    With information about which identifier is used where, and by which function. This section is not implemented to the map by default. If you want it you must manually enable it using the iil[+] option.

  5. List of calling sequences
    This is a hierarcial view of how all your functions are called. All top level functions are listed within separate trees. By default this section is generated as a compact list, but you may let SM generate it as a flow chart if you like. To do this you must use the csf[2] option.

  6. Source lines map
    This section lists the source code of the modules in your project. For each function you will se a list of which function(s) calling it. You will also se every comment lines clearly marked, as well as a smart block indentation level marking. Each line will be listed with its global line number reference, as well as its local.

All this will (by default) be included within C-style comments. This let you actually compile the map as one-single-huge module.

In addition you have access to a number of other functions in Source Mapper:

  1. Automatically add a page-break-character above each function/module/section. You can also put a string (e.g. "/*{Pagebreak}*/") at different locations in your sources of which SM will automatically replace with a new-page-char in the map. For more information, see the options NPs[] and NPS[] (New-Page-String).

  2. Optional sorting methods.

  3. Optional level of display output during map generation (see option dis[n]).

  4. Make/Build/Link options to let you control if SM will delete .smo-files or not. If you choose not to delete them, then the generation time may be dramatically reduced the next time you generate a map of the same project. If one of the source modules has changed, then SM will automatically rebuild the corresponding .smo-file.

To get help about which functions are availible, just type "sm.exe hlp[]" at the command prompt, and you are on the road...

Hints and Tips

  1. Remember: SM isn't actually a compiler. It's just a stupid parser that has the ability to reqognice most C style code. Therefore, try to write your code as structured as possible, containing as few odd statements as possible. This is true if you use much preprocessor code, which SM hasn't the ability to reqognice as good as it reqognices the true C code.

  2. If you get some strange error messages (or map output) during the generation of a source map: Try to delete all SM-object files (.smo-files) of your project and make the map again. Optionally you can turn the 'dto[+]' option on (auto delete .smg-files after use) to make sure that SM will always use fresh .smg-files.

  3. If you get some strange (or maybe even buggy) output from SM, then please take a close look at the source code of where the error seems to occour. SM has some problems on parse some rare types of syntax. (See paragraph #1.)

Things to add or fix

  1. All language dependent information (except text strings) should be user configurable. This is true for key words of the C language, graphical characters of lines, etc.

  2. Support for redirected input/output (stdin/stdout).

  3. Improved security when creating files. Eventually asking user if it's ok to write over an already existing file. This is true in case the file is of a type other than the type that SM is about to create.

  4. Adjustable default extention of sources and maps (+ other files).

  5. All error messages should be written to stderr rather than stdout by default.

  6. Option: Automatic convert from tabulator characters to spaces (in sources).

  7. Option: Include/exclude external functions to/from list of calling sequences.

  8. A GUI-shell of where the user can adjust the project and its settings simply by drag/drop and click using the mouse.

Warranty

Use of this software for any purpose whatsoever constitutes your unqualified acceptance of the following statements.

The author makes no warranty or representation that the software will be error free. The author disclaims any warranties, either express or implied, including but not limited to any implied warranty of merchantability or fitness for any particular purpose.

The user agrees to take full responsibility for the selection of and any use whatsoever made of the software.

IN NO EVENT WILL THE AUTHOR BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING WITHOUT LIMITATION DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION OR THE LIKE) ARISING OUT OF THE USE OF, INTERRUPTION IN THE USE OF, OR INABILITY TO USE THIS SOFTWARE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF ANY POSSIBILITY OR LIKELIHOOD OF SUCH DAMAGES.

Back to The Larsen Page