RESERVED WORDS Reserved words as the name implies are reserved for the language. Reserved words must not be used as names of objects, types, procedures, or anything else. There are relatively few "reserved words" . But don't be complacent. The next pages cover a lot of types,objects and other names that are not technically reserved words but can create havoc if used in the wrong place! Some common pairs of reserved words are shown. Spaces are important in Ada. Word use or some uses ____ ________________ abort Statement in a task, abort means kill the task abs Function that returns absolute value abstract Declare a type or subprogram to be abstract, generic formal type abstract tagged limited private accept Statement in a task, the executable entry point access Used in defining access ( pointer ) types aliased Declare a variable of an aliased type all A selector. If XXX is an access variable then XXX.all is the object pointed to and Boolean binary operator and then Conditional "short circuit" array Used to define array types at Used as part of representation specification begin Always has pairing " end " body Used in " package body " and " task body " case Executable control structure and in defining records constant What follows can not be changed, attempt will cause error declare Can precede " begin " in executable structure, allows putting declarations in middle of executable code delay Statement in tasking, allows other tasks to run, then wakes up after delayed time has elapsed delta Part of type declaration for fixed point digits Part of type declaration for floating point do Used in tasking " accept...do...end " The FORTRAN " DO " is " for " in Ada else Part of " if ... then ... else ... end if ; " else Part of selective wait in tasks else Part of conditional entry in tasks elsif Watch the SPELLING! one word in Ada, means else if end ; Ends a structure e.g. begin, procedure, package, end USER_NAME ; task etc. Optional user name is allowed, thus must always be followed by a semicolon end case ; Ends " case " control structure end loop ; Ends " loop " control structure end if ; Ends " if " control structure end record ; Ends definition of a record data structure end select ; Ends " select " control structure in tasks entry Task entry definition ( not procedure or function entry ) exception Statement in " begin ... exception ... end " specifies a place to put executable code for exception handlers exception Used to define user created exceptions exit Statement in a loop structure, 4 forms available for Statement introducing one type of loop for Used in type definitions function Statement defining a function generic Used in creating generic packages goto One word! Use it sparingly, only when needed. There are scope rules that apply if Conditional statement in Used in type definitions in As in input parameter to a procedure in Used with " for " in iteration such as " for I in 1..N loop ... end loop " in out As in both input and output parameter in a procedure is Used in type,procedure,function, and package definitions is new Used to get new type or generic instantiation is access all Used as type Ptr is access all T; for aliased T's limited Used with " private " loop Executable structure, always closed by " end loop " mod Binary modulo operator in expressions mod (at mod) Rare usage in representation specifications new (is new) Used in instantiation of generic packages new Used to get more storage with " access " types new (is new) Used to create new types not Boolean unary operator null ; The null statement, sometimes needed if code not finished null Used in place of some values when needed but not known of Used as part of a type definition, such as " array(1..N) of INTEGER " or Boolean binary operator Statement in " select " tasking structure or else Conditional expression " short circuit " others Used where some cases are specified and all else is lumped under others. Many forms out As in output parameter of a procedure package A container for declarations and code package body A container that is used with a corresponding package specification pragma A directive to the compiler private Statement between visible and private declarations procedure First word of a procedure definition protected Used on objects, subtrograms, entries, types, bodies declarations and units. raise Statement to cause an exception to be raised range Part of a type specification record Start of a record data structure definition rem Binary arithmetic operator, remainder after division This is precisely defined in Ada renames Used to help get around name hiding and to avoid using selectors dot notation requeue Used to requeue an entry return Can be used in a procedure, not usually needed return VALUE ; Must be used in a function for the returned value reverse Used with " for " to get the loop to run backwards select Statement in a task to control entry separate Used for partial compilation, only needed in rare cases. Separate compilation is normal with Ada and usually does not need the reserved word " separate " subtype Used in place of " type " when just constraining a type tagged Created a record that is expandable, a tagged type task Introduces a task definition task type Introduces a task type definition terminate Used on students that don't complete homework on time and rarely needed in tasks then Used in " if ... then ... else ..." structure type Used to declare a user defined type until Wait for a definition until ... use Usually follows a " with " Used in representation specification when Statement in case and exception handlers Usually of the form " when XXX => " when others => Means else, e.g. all others while Used to introduce a loop, user does initialization and computing values that control the condition with Makes a previously compiled package specification available in this compilation Usually " with XXX ; use XXX ; " xor Boolean binary operator, exclusive or