. navigate
 Navigate
A. High-level I/O left arrow
x
right arrow C. Built-in Types
Red Reference Manual
B.

PRAGMATS



B.   PRAGMATS


pragmat diagram
C - identifier

Pragmats supply information, that does not affect program semantics, to the translator. Some pragmats are language-defined; all translators are expected to recognize these pragmats (although the translator is not required to take any action). A translator can also permit additional pragmats to be specified.



RULES

A list of pragmats can appear between any two tokens in a program. Certain of the pragmats are further restricted in where they can appear. The restrictions for each pragmat is given below.



OPTIMIZE

This pragmat is used to inform the translator whether or not to optimize.

If the OPTIMIZE pragmat appears on a scope, it is applied to this scope, and to all scopes nested within this scope that do not, themselves, specify an OPTIMIZE pragmat.

If the OPTIMIZE pragmat appears on a variable or constant declaration, it controls the representation for the data item.

If the OPTIMIZE pragmat appears on a type declaration, it applies to the representation of all data items having that type.



SUPPRESS

Each of the identifiers must be exceptions. This pragmat indicates that no code need be generated to check for any of the listed exceptions during elaboration of the scope on which it is specified. Code will still be generated, however, for the guarded bodies of guard statements which explicitly handle the listed exceptions. It the exception actually occurs, the effect is undefined.



OPEN and CLOSED

These pragmats are specified on a deferred declaration or on an invocation of a deferred declaration. On a deferred declaration, they refer to all invocations. On an invocation, they refer to only that specific invocation. OPEN requests the translator to attempt to compile the invocation open (inline). CLOSED requests the translator to attempt to compile the invocation closed (out of line).



LIST

This pragmat can be specified between any two tokens. LIST(0FF) specifies that the source listing is not to be printed until the next LIST(0N) pragmat appears.



NONRECURSIVE and NONREENTRANT

These pragmats can be specified on a deferred declaration. They are used to inform the translator that the deferred declaration will not be invoked recursively (i.e., during its own elaboration) or reentrantly (simultaneously by two or more activations). If the translator or linker discovers that these pragmats were wrong, an error will be issued.



OK

This pragmat is used to turn off warning messages issued by the translator when lt discovers that dangerous aliasing or dangerous sharing will, or might, occur. The 0K(ALIAS) pragmat can appear either on deferred declarations or an invocations. The OK<(SHARE) pragmat can appear on variable declarations, constant declarations, and formal parameter definitions.



Placement of Pragmats

Pragmats can appear:

  1. On a scope. The pragmat must appear immediately before the first token of the scope. For example,

    on a scope example



  2. On a variable declaration, constant declaration, formal parameter definition, or actual parameter. The pragmat must appear between the last token and the terminating ";" or "," or "/". For example,

    on variable decl constant decl or parameter def example



  3. On a deferred declaration. For compound declarations, the pragmat must appear immediately before the ";" terminating the header. For type and abbreviation declarations, the pragmat must appear immediately before the terminating ";". For example,

    on deferred declaration example








A. High-level I/O left arrow
x
right arrow C. Built-in Types


Overview

Requirements
     Strawman
     Woodenman
     Tinman
     Ironman
     Steelman

RED Reference
RED Rationale

Types in RED
Time/Life Computer Languages
Memories

Site Index

Overview             Reference ToC             Rationale ToC             Site Index



Home   Favorites   Map

IME logo Copyright © 2009, Mary S. Van Deusen