Annotation elements can also be structured as redeclarations. Here is an example of a level-three nested choices redeclaration annotation using short class definitions in the redeclarations:
The Resistor2 example below illustrates that annotation elements can occur anywhere among the list of elements in a class. The public keyword is used to end the equation section before starting the annotation, otherwise the annotation becomes associated with the equation section:
Class annotations for classes defined by short class definitions are placed at the end of the declaration. For example, the Icon annotation is placed at the end of the Velocity declaration below, after the optional string comment:
Annotations can also be used to attach documentation information to a package:
A variable annotation associates information with a declared variable. Such an annotation is placed at the end of the variable declaration after the optional string comment.
As for variable annotations, import annotations are placed at the end of the import statement after the optional string comment, e.g.:
The most common form of equation annotation is annotations to connect equations. It is natural to associate graphical attributes such as lines with a certain position, length, and color to such equations. Notice that the declaration is placed at the end, after the optional comment, as in Variable and Import Annotations.
Statements can also be annotated, even though the need is less obvious than for connection equations. As for equations, statement annotations are placed at the end of the statement after the optional string comment, e.g.: