United States |
Previous | Contents | Index |
This appendix provides information on tools that you can use to develop
and refine your C++ programs. Some ship with the OpenVMS operating
system but others require separate purchase.
A.1 DEC Language-Sensitive Editor
The DEC Language-Sensitive Editor (LSE) is a text editor intended specifically for software development. LSE includes the following features:
To invoke LSE and associate a buffer with C++, use the following syntax:
lsedit [/qualifier...]filename.cxx |
To invoke LSE without associating the editing buffer with a programming language, enter the following command at the DCL prompt:
$ lsedit file-spec |
To end an LSE session, press Ctrl/Z to get the LSE> prompt. Then,
enter the
exit
command if you want to save the current file modification, or enter the
quit
command if you want to discard the current file modification.
A.1.2 LSE Placeholders and Tokens
The language-sensitive features of LSE simplify the tasks of writing and maintaining program code. Among these features are placeholders and tokens.
Placeholders are markers in the source code that indicate where a program element is expected. Placeholders are worded to denote the appropriate syntax in a given context. You do not need to type placeholders; LSE inserts them, surrounded by brackets ([]) or braces ({}) and at signs (@). Braces indicate where source code is required in the program's context; brackets indicate that you have the option of supplying additional constructs or erasing the placeholder.
Tokens are LSE words that, when expanded, provide additional language constructs. You can type tokens directly into the buffer. You use tokens in situations such as modifying an existing program to add program elements where no placeholders exist. For example, if you type while and then enter the expand command, a template for a while construct appears in your buffer in place of the characters you typed. You also can use tokens as a shortcut in situations where expanding a placeholder would entail a complicated sequence of actions.
LSE has commands for manipulating tokens and placeholders, as follows:
Command | Default Key Binding | Description |
---|---|---|
expand | Ctrl/E | Expands a placeholder |
unexpand | PF1-Ctrl/E | Reverses the effect of the most recent placeholder expansion |
goto placeholder/forward | Ctrl/N | Moves the cursor forward to the next placeholder |
goto placeholder/reverse | Ctrl/P | Moves the cursor backward to the previous placeholder |
erase placeholder/forward | Ctrl/K | Erases a placeholder |
unerase placeholder | PF1-Ctrl/K | Restores the most recently erased placeholder |
<downarrow symbol> | Down arrow | Moves the selection indicator downward through a screen menu |
<uparrow symbol> | up arrow | Moves the selection indicator upward through a screen menu |
|
[Enter]
[Return] |
Selects a menu option |
To display a list of all the predefined tokens supplied with C++, enter the following LSE command:
LSE> show token |
To display a list of all the predefined placeholders supplied with C++, enter the following LSE command:
LSE> show placeholder |
For information about a particular token or placeholder, specify the name of the token or placeholder after the show token or show placeholder command.
To create a list of either tokens or placeholders, first execute the appropriate show command to put the list in the $show buffer. Then, enter the following commands:
LSE> go buffer $show LSE> write file-spec |
When you exit LSE, you can use the DCL
print
command to print a copy of the file you wrote.
A.1.3 Compiling and Reviewing Source Code from an LSE Session
To compile your source code and to review compilation errors without leaving the editing session, use the LSE commands compile and review . The compile command issues a DCL command in a subprocess to invoke the compiler. The compiler then generates a file of compile-time diagnostic information that LSE uses to review any compilation errors. The diagnostic information is generated with the /diagnostics qualifier that LSE appends to the compilation command.
For example, if you enter the compile command while editing the buffer user.cxx , LSE executes the following DCL command:
$ cxx user.cxx/diagnostics=user.dia |
LSE supports all the command qualifiers available with the compiler.
The
review
command displays any diagnostic messages that result from a
compilation. LSE displays the compilation errors in one window and
corresponding source code in a second window. This lets you view the
error messages while examining the associated code.
A.1.4 DEC Source Code Analyzer (SCA)
Although the compiler does not support the DEC Source Code Analyzer (SCA) through the LSE /analysis_data command line qualifier, users can generate a .ana file that contains information on all the tokens within a C++ program. For example, users can do the following:
SCA> find some_variable_name |
To use the SCA analyze command with C++ files so that in turn you can execute find commands on your C++ code from LSE or SCA, do the following:
$ SCA |
SCA> set library projdisk:[user.any_existing_sca_lib] |
SCA> analyze testprog.cxx |
SCA> load testprog.ana |
Previous | Next | Contents | Index |
|