Hide Comments

Code and Documentation Comments

Documentation comments MAY be added to many RAPID-ML™ language elements, and code comments MAY be added anywhere in the code. Documentation comments may span multiple lines. Code comments have two forms: single-line and multi-line.

Syntax

Documentation Comments

/** <comment> */

Single-line Code Comments

// <comment>

Multi-line Code Comments

/* <comment> */

Examples

/** This is a documentation comment for the TaxBlaster rapidModel element. */

rapidModel TaxBlaster

/** This is a documentation comment for the InterfaceModel resourceAPI element. */

resourceAPI InterfaceModel baseURI "http://localhost:8080" // This is a single-line code comment inserted at the end of a line.

/** This is a documentation comment for the DataModel dataModel element. */

 

// This is a single-line code comment, which can be inserted *anywhere*.

 

dataModel DataModel

/* This is a multi-line

code

comment. */

/** This is a documentation comment

spanning

multiple

lines. */

structure MyDataType

id : string

Parameters

Name

Type

Description

<comment>

Free text

A free text description of an element or some aspect of the code.

Child Elements

None.

Parent Elements

None.

Discussion

Documentation for Model Elements

Documentation comments MAY precede all of the elements listed below:

RAPID Model
Resource API
Collection Resource
Object Resource
Template Parameter
Method
Request
Response
Data Model
Data Structure
Primitive Property
Reference Property
Simple Type
Enumeration
Enumeration Constant
Media Type Definition
Link Relation Definition
Security Scheme Library
Security Scheme Definition

Whitespace Normalization in Documentation Comments

Within a documentation comment, whitespace is normalized as follows:

A whitespace sequence containing zero or more spaces and/or tabs, and containing a single line break anywhere in the sequence, is normalized to a single space.
A whitespace sequence containing zero or more spaces and/or tabs, and containing two line breaks anywhere in the sequence, is normalized to a sequence of two line breaks, resulting in a blank line between the preceding and following non-whitespace character sequences.

Conformant editors and parsers MUST apply these whitespace normalization rules.

Documentation as Model Properties

Model elements allowing documentation comments treat the whitespace-normalized documentation content as an element property.  Conformant parsers SHOULD preserve the whitespace-normalized documentation in the abstract syntax tree or other intermediate and output representations.

Code comments are not part of the model, and are not expected to be preserved as model element properties  Conformant parsers MAY safely ignore or discard code comments.

Created with Help & Manual 6 and styled with Premium Pack Version 2.51 © by EC Software