The Object Constraint Language: Getting Your Models Ready for MDA (2nd Edition)

OCL expressions can contain comments . An OCL line comment begins with two hyphens. All text from the hyphens to the end of the line is considered to be a comment. Comments longer than one line may be enclosed between /* and */. For example, the following lines contain valid OCL expressions:

[View full width]

[View full width]

-- the expression 20 * 5 + 4 should be evaluated here 20 * 5 + 4 -- this is a comment /* this is a very long comment that does not enlighten the reader one bit about what the expression is really about */

The following line is not a valid OCL expression:

20 * -- this is a comment 5 + 4

Категории