Synopsis 0.5 - User Manual

Comments

This is the most complex Linker operation, since it is itself composed of multiple "comment processors" which work on comments attached to declarations. They should generally be in the following order, if present. You will always need a comment-identifier processor first, and the summary processor last.

ssd

This processor identifies comments in the //. style. Any comment line not starting with //. will be removed, and the //. is stripped from those that do have it.

//. This is a comment
//. With multiple lines

ss

This processor identifies comments in the // style. Any comment line not starting with // will be removed, and the // is stripped from those that do have it.

// This is a comment
// With multiple lines

java

This processor identifies comments in the /** .. */ style. Any comment not beginning with /** and ending with */ will be removed, and the /**, */ and any * at the start of a line are stripped from those that have them.

/** This is a comment
 * With multiple lines */
/** This is a comment
 * With multiple lines
 */

qt

This processor identifies comments in the Qt style. There are two types of comments: brief and detail. Brief starts with //! and there must be only one. Detail comments are surrounded by /*! and */.

//! Summary of this comment
/*! More info about the declaration
    There can be multiple lines.
    Must end with */

group

Looks for sequences of declarations to group together by looking for a '{' in a comment and a '}' in a following comment in the same scope. The '{' and '}' must be at the beginning of a line, but may have a group name after them on the same line. For example:

class Foo {
public:
    //. Methods for accessing attributes of
    //. this Foo
    //. { Accessor methods
    //. Get a Bar
    Bar* get_bar();
    //. Set the Bar
    //. @param bar the Bar to set
    void set_bar(Bar* bar);
    //. }
};

Note that you will need to set 'extract_tails' in the C++ parser for the above example to work, since the last comment is between the last declaration and a closing brace! If you set extract_tails, you will also need one of 'dummy' or 'prev'.

dummy

Removes the dummy declarations created by setting "extract_tails" in the C++ parser. Any comments they had are lost. See the 'prev' processor below.

prev

Checks comments to see if they start with a '<'. If so, they are moved to the previous declaration. Any dummy declarations are removed once the comments have been checked. This can be used to put the comments after the declarations, like so:

void func();
//.< Some function

//. My enumeration
enum Foo {
  One, //.< The first enumerator
  Two, //.< The second
  Three //.< The third
};

Note that it does not work for function parameters. To document parameters, enable the 'javatags' processor and use "@param" tags in your comments.

javatags

Extracts java-style @tags from the ends of comments, and stores them in the tags() list of the Comment object. Each tag is a CommentTag object. The tags may be inspected by the formatters or other processors.

You will need to use this processor if you want to use java-style @tags, since the HTML formatter no longer looks for them itself.

summary

This processor joins all the comments together for each declaration then attempts to make a summary of the comment from the first sentence. The summary is stored with the comment. It is used by the formatters extensively so you will almost always want this processor.