Introduction to the GRASP Environment

As is described elsewhere at this site, GRASP is a software visualization tool that generates a CSD for a given program unit and provides a seamless integration with various compilers (dependent on your language and native OS) to perform other functions associated with code development. GRASP is used to create, edit, compile, and run Ada 95, C, C++ and Java programs. This section of the site will introduce GRASP and give a brief overview on its most common features.


pcGRASP

An Introduction/On-line documentation to pcGRASP.


UNIX

The introduction to the UNIX version of GRASP is divided into two major sections, one of which describes the control panel and the other which describes the CSD window. Since there are a few minor differences in the CSD window that depend on the language chosen, there are separate introductions for each language. To begin, select below.

Begin Introduction to the Control Panel Begin Introduction to the CSD Window (Ada 95)

Begin Introduction to the CSD Window (C)

Begin Introduction to the CSD Window (C++)

Begin Introduction to the CSD Window (Java)

A feature new to the UNIX versions of GRASP is the ability to perform batch file operations, either printing or file formatting, from the command line. (This information is also available at the command line by running grasp -h.)

The usage for GRASP's batch processing is as follows:

grasp -bp|-bf C|Java|Ada|C++ <opt1> <opt2> ... -files <file1> <file2> ...

-bp is used for batch generation of PostScript files with CSDs generated by default.
-bf is used for batch formatting (pretty-printing) of files. Note that files are backed up automatically to filename.grasp.back before being formatted.

Printing and Formatting options

-force force a newline for each statement or declaration
-align enable parenthesis alignment
-indent indent braces to match structure interior (C and C++)
-cparse0 parse all headers and expand macros (C and C++)
-cparse1 parse local headers and expand macros (C and C++)
-cparse2 do not parse headers, do expand macros (C and C++)
-cparse3 do not parse headers or expand macros (C and C++)
-cppalttokens use alternate tokens for C++

Additional Printing Options
-nocsd do not generate a csd
-ext extension append extension to PostScript files. The default is .grasp.ps .
-number add line numbers
-nounitsyms do not draw CSD unit symbols
-nodatasyms do not draw data symbols
-noboxes do not draw boxes
-size size point size; the default is 10
-papersize size papersize as ISO designation or WxHunits where units is in or mm . Examples: A4 8.5x11in .
-fnameheader use the filename as a page header
-pgnums print page numbers
-nobold no not print bold keywords
-noslant do no print slant comments
-lmargin lmargin left margin; the default is 0.5 inches
-rmargin rmargin right margin; the default is 0.5 inches
-tmargin tmargin top margin; the default is 0.5 inches
-bmargin bmargin bottom margin; the default is 0.5 inches
-columns num_of_columns number of columns; the default is 1
-gutter gutter_size gutter for multiple columns; the default is 0.5 inches
-landscape print in landscape mode (GRASP defaults to portrait)
-coltext color text color; the default is black
-colstring color string color; the default is black
-colkey color keyword color; the default is black
-colcomment color comment color; the default is black
-colnumber color number color; the default is black
-colop color operator color; the default is black
-colid color identifier color; the default is black
-colcsd color CSD color; the default is black

Legal colors for printing are as follows: black, white, green, blue, red, purple, orange, grey, cyan, dark_green, dark_blue, dark_red, dark_purple, dark_orange, dark_grey

Enviornment Variables

The following environment variables are used in batch mode printing and formatting

GRASP_BATCH_MACROS predefined macros for C and C++
GRASP_BATCH_INCLUDES include path for C and C++
GRASP_BATCH_HEADER (printing only) printed header for all files

Return to the GRASP Documentation Page