Skip to content

Comments

Putting comments inside code helps describing its features, especially if the project is shared by a team.
Comments are not code, they are not evaluated by the text intelligence engine, their only purpose is documentation.
It is recommended to write meaningful comments that will help both other programmers and, in time, the author, to understand what the code does (or is supposed to do!).

There are two types of comments that can be inserted into rule files:

  • Line comments
  • Block comments

Line comments can be on a line by itself or be placed at the end of a line of code after at least one blank. The syntax of a line comment is:

//[comment text]

Block comments occupy one line or multiple consecutive lines. The syntax is:

/*[comment text]*/

for one-line comments, or:

/*[comment text
comment text
...
comment text]*/

for multi-line comments.

The parts between square brackets are optional, so empty comments are allowed.

Warning

Don't put block comments in the middle of a statement.
For example in:

SCOPE SENTENCE IN SEGMENT(PP, /* PPN,PPF,PPM,PPI */ PPNI)

parts of the comment would be erroneously interpreted as segment names.

Some comments have extra meaning in Studio: these are called reminders. Read the article dedicated to this topic in the Studio manual to learn more.