occ(1)

occ1

Openc++ compiler

Usage

occ [-g] [-M option=value] [-l] [-S metaclass] [-s] [-V] [-v] [-w] [-n] [-p] [-E] [-c] [-P] [-m file_name] [-I directory] [-D name=def] [-d option] [-C] [--regular-c++] [-- C++ compiler options] source_file

Overview

occ applying a meta-level program to an OpenC++ program, and compiles the result program.

Full documentation can be found in /usr/share/doc/openc++.

Options

Main options

-g

Produce debugging information.

-M option=value

Specify an option with value. It is passed to metaobjects.

-l

Print the list of statically loaded metaclasses.

-S metaclass

Load a metaclass.

-s

Print the whole parse tree of the given source program. Don't perform translation or compilation. If no source file is given, occ reads from the standard input.

-V

Show the version number.

-v

Specify the verbose mode.

-w

Enable wide characters support.

Building stages options

-n

Suppress invoking the preprocessor.

-p

Stop after the parsing stage. No translation is done.

-E

Don't run the back-end C++ compiler. Stop after generating a .ii file.

-c

Suppress linking and produce a .o file.

-P

Preprocess again after translation.

-m file_name

Produce a shared library (a .so file). This is used to compile a metaclass. If file_name is specified, the name of the shared library is file_name.so. If the -c option is specified together, occ produces a .so file, which should be linked by the user to be a shared library.

Preprocessor options

-I directory

Add a directory to the search path of the #include directive.

-D name=def

Define a macro name as def.

-d option

Specify a preprocessor option

-C

Don't discard comments

Other options

--regular-c++

Inhibit the extended syntax. This enables the keyword metaclass to be used as a variable name. This option is useful when parsing legacy code being not intended to translation. When this option is used, the symbol __opencxx is not defined.

--

The following options are interpreted as options for the back-end C++ compiler. For example, if you type:

% occ -I.. -- -g foo.c

Then the -g option is passed to the C++ compiler. Note that these options are not passed to the C++ preprocessor. The -D and -I options need to be placed before --.

Files

file.{cc,C,c,cpp,cxx,mc} source file.

file.occ output file after C++ preprocessing.

file.ii output file after translation.

file.o object file.

file.so shared library dynamically loaded by occ.

/usr/lib/libocc.so library to link with meta-level program.

Notes

While the C++ processor is running, the macro __opencxx is predefined.

The programs compiled by occ do not need any runtime libraries or a garbage collector unless the meta-level program requires them at the base level.

Releases

4 releases since Debian 2.1 (Slink); the text changed 1 time.

  1. 2.1–3.0
  2. 3.1

-- since Debian 3.1 (Sarge); --regular-c++ since Debian 3.1 (Sarge); -C since Debian 3.1 (Sarge); -D since Debian 3.1 (Sarge); -E since Debian 3.1 (Sarge); -I since Debian 3.1 (Sarge); -M since Debian 3.1 (Sarge); -P since Debian 3.1 (Sarge); -S since Debian 3.1 (Sarge); -V since Debian 3.1 (Sarge); -c since Debian 3.1 (Sarge); -d since Debian 3.1 (Sarge); -g since Debian 3.1 (Sarge); -l since Debian 3.1 (Sarge); -m since Debian 3.1 (Sarge); -n since Debian 3.1 (Sarge); -p since Debian 3.1 (Sarge); -s since Debian 3.1 (Sarge); -v since Debian 3.1 (Sarge); -w since Debian 3.1 (Sarge).

Author

OpenC++ was initially written by Shigeru Chiba<[email protected]>, University of Tsukuba, Japan. It is now further developped by a Grzegorz Jakacki <[email protected]> and other people.

This manpage was initially written by John Lapeyre for the Debian GNU/Linux openc++ package, and was later reformated and updated by Yann Dirson.

From openc++ 2.8-4 in Debian 3.1 (Sarge). Parsed by carta from the page's man source.