Directives are not part of the grammar of a programming language, and may vary from compiler to compiler. They can be preprocessor directives in c pdf by a preprocessor to specify compiler behavior, or function as a form of in-band parameterization. In some cases directives specify global behavior, while in other cases they only affect a local section, such as a block of programming code.
In some cases, such as some C programs, directives are optional compiler hints, and may be ignored, but normally they are prescriptive, and must be followed. However, a directive does not perform any action in the language itself, but rather only a change in the behavior of the compiler.
The term “directive” is also applied in a variety of ways that are similar to the term command. Two notable users of this directive are OpenMP and OpenACC.
A common use of pragmats in ALGOL 68 is in specifying a stropping regime, meaning “how keywords are indicated”. With one exception, declarations are optional, and do not affect the semantics of the program. The one exception is special, which must be specified where appropriate.
In Turbo Pascal, directives are called significant comments, because in the language grammar they follow the same syntax as comments. Haskell pragmas are specified using a specialized comment syntax, e.