Crunch CRiSP File Editor 6 User Manual

Page 91

Advertising
background image

Page 91

files are compiled directly into loadable files with a .cm extension).

CRiSP can load .m files directly without any need for compilation, but this can be slower than loading an
equivalent compiled file so this facility is rarely used or needed.

The .m source files are compiled with the cm program.

*** NOTE ***

The name 'cm' conflicts with the calendar manager utility which is available under SunOS 4.x and
Solaris 2.x when using OpenLOOK. Because of this conflict, you may have problems accessing the
correct 'cm' program when you try to run this program from within XView. You can use the crunch
compiler to compile '.m' files and this knows how to avoid running the wrong 'cm' program so it is
advisable to use this.

The 'cm' compiler converts macros in source form (.m files) to a compact compiled form (.cm) files. CRiSP
can read .m files or .cm files at run time, but the .cm format loads faster and avoids CRiSP having to parse
an input file, skipping over comments etc.

The command line syntax for 'cm' is:

cm [-aLl] [-o output_file] file1.m file2.m ..

The usual way to invoke cm is simply:

cm fred.m

This compiles the file fred.m, and creates a file fred.cm in the same directory as fred.m. Compiled macro
files are loaded significantly more quickly and execute slightly more efficiently than pure source files.

cm checks for syntax errors as it goes along - the most common errors are unmatched brackets, and
unterminated string constants.

cm has a number of switches. Most of these are used for debugging the compiler itself and for
disassembling compiled macro files.

-32, -64

CRiSP supports two types of macro file formats, one for 64-bit machines and the other for
32-bit machines. You can use these switches to convert a .cm file into the appropriate
format.

Not normally needed by end users.

-a

This switch is used to print out the relative amount of space used by individual
components of the compiled language. It is used for fine tuning the pseudo code
generated by the compiler. Most users can ignore this switch.

-l

This switch is used to print out each macro so that the internal parsing can be checked.
This switch currently does not work.

-L

This switch is used to print out the internal pseudo code used to represent a macro and
allows debugging of the internal code generator. This switch currently does not work.

-o filename

Specify name of output file to create.

-S

Dump the macro string table section.

-V

Print the version number.

Advertising