Synopsis 0.5 - User Manual

Linker options

The options for all the Linker operations except XRefCompiler are listed here:

verbose (boolean)

Verbosity flag. For config files, this attribute is set by the constructor, but only if 'verbose' was passed as a config option.

Can be set to true from the command line with "-Wl,-v"

operations (list of strings)

If set, overrides the default list of operations to use in the Linker stage. Note that all operations except LanguageMapper and XRefCompiler do nothing without other options being set, so the default list is:

[ 'Unduplicator', 'Stripper', 'NameMapper', 'Comments', 'EmptyNS', 'AccessRestrictor' ]

Note that the operations are executed in order.

strip (list of strings)

If set, causes the Stripper operation to strip prefixes from names in the list, and remove declarations which don't match any prefix. Typical usage just has one prefix. Each prefix is a scoped name, with the scopes separated by "::".

Can be set on the command line with, e.g.: "-Wl,-s,Synopsis::Parser::C++"

mapper_list (list of: strings or 2-tuples of strings)

(This feature will be moved to an actual Operation in future releases and cleaned up).

mapper_list specifies a list of either builtin mappers or external mappers that map the names of Unknown types. An Unknown type is one that refers to a type which is not a declaration in the AST. For example, if you parse your C++ CORBA object but not the skeleton/stub .hh files, then any reference to a Fresco::POA_Graphic type object will be Unknown (since there is no Fresco::POA_Graphic in the AST). The builtin mapper "C++toIDL" transforms any unknown type name starting with POA_ to remove the POA_ and change the type to IDL, and any type name ending with _ptr to remove the _ptr and change the type to IDL. See the Mixed demo for an example of this in action.

The elements of the list may be a string, in which case it must be one of the builtin mappers (there is only one: C++toIDL currently), or it may be a 2-tuple of ("module name or filename.py", "object in module"). The object in the module must have a "map" function or method that takes one argument: the Unknown type (see Synopsis.Core.Type.Unknown). The module name must be importable, which means it must be accessible from the PYTHON_PATH. A filename can be anywhere but must end in ".py".

Can be set on the command line with, e.g.: "-Wl,-m,module" where module is either a module name or a filename.

...or with, e.g.: "-Wl,-M,C++toIDL" to specify a builtin module.

max_access (integer)

If set, removes any declaration that doesn't meet a level of visibility. This can be used to prune private or protected declarations from the AST so they wont be in the output. Values are:

1 : protected and private declarations removed

2 : private declarations removed

These actually follow the levels defined in Synopsis.Core.AST - levels higher than the given are removed (default is 0, public is 1, protected is 2, private is 3).

map_declaration_names (2-tuple or 2-list of name, type)

If set, causes all declarations to be mapped into a module of the given name and type. The name must be a scoped name, with "::" separating scopes. The type is the type of the modules used to extend the declarations into the given scope.

For example, the Synopsis RefManual uses this option to move all the C++ declarations into the Synopsis.Parser.C++ python package with this option:

map_declaration_names = 'Synopsis::Parser::C++', 'Package'

Package is used as the type since the Python AST has Packages for Synopsis, Parser and C++. (Note they are AST.Module objects, with type() set to "Package").

All types referring to these declarations are renamed as appropriate.

comment_processors (list of strings)

If set, overrides the default setting of ['summary']. Gives a list of comment processors to apply, in order, to the AST. See the Comments section above for a list of these and what they do.