Go to the first, previous, next, last section, table of contents.


4.3 Annotations

If what looks to C++ as a comment starts with an at-sign (@) as its first character, then it is not considered a comment by Larch/C++. We shall refer to the tokens between //@ and the following newline, and between pairs of /*@ and @*/ as annotations. Annotations look like comments to C++, and are thus ignored by it, but they are significant to Larch/C++. This is achieved by having Larch/C++ drop (i.e., do nothing with) the character sequences that are annotation-markers: //@, /*@, and @*/.

annotation-marker ::= //@ | /*@ | @*/

Within an annotation, all of the syntax of Larch/C++ is recognized, including comments and even annotations. The following are examples of C++ style annotations, that show some comments within the annotations.

// @(#)$Id: annotations.lh,v 1.3 1997/06/03 20:29:57 leavens Exp $
int returns7() throw();
//@ behavior {  // this is the behavior of returns7
//@   ensures result = 7;    /* a gratituous comment */
//@ }


Go to the first, previous, next, last section, table of contents.