Download presentation
Presentation is loading. Please wait.
Published byClifford Watson Modified over 9 years ago
1
Essential Ada Terminology copyright © Michael B. Feldman, All Rights Reserved
2
Essential Ada Terminology type: a set of values and a set of operations which may be validly applied to those values subtype: a subset of the parent type’s set of values; all operations are inherited from the parent (don’t confuse this with subclassing as used in an OOL context) variable: an object which has a type that can be determined at compilation time constant: like a variable, but its value cannot be modified during the program’s execution exception: a kind of exceptional situation occurring at execution time. Predefined and user-defined exceptions are raised (like thrown in C++/Java) where the situation occurs and handled (like caught), by default, according to rules in the standard. The programmer can override the default behavior by writing exception handlers at appropriate points in the program. The most common exceptions are Constraint_Error (out of range condition) and Ada.Text_IO.Data_Error (invalid input data).
3
Essential Ada Terminology (continued) compilation unit: function, procedure, package specification, package body, generic template NOTE: In the Ada standard there is no concept of a source file. A single OS-level file can contain one or many compilation units; it makes no difference in the meaning of these units. Generally a compiler will have a preferred file structure (e.g. one unit per file, like GNAT), but this can usually be overridden. subprogram: function, procedure NOTE: These are different from each other in Ada. A function is value-returning and may have only in parameters; a procedure is not value-returning and may have in, out, or in out parameters. main program: (usually) a procedure package: Ada’s encapsulation mechanism—collects together types, variables, constants, subprograms, tasks NOTE: a package is not a class (as seen in some OOLs); a class is, in essence, a type, while a package is just an encapsulation that may export a type. A package + a type give a reasonable equivalent to a class.
4
Essential Ada Terminology package specification: contains the package’s “table of contents” (similar to a C/C++ “header file”, but required in Ada) package body: contains the code segments that implement the package’s subprograms and tasks task: program segment that is intended to be executed simultaneously with other tasks—has aspects similar to procedure, package, and data structure, but is not exactly any of these NOTE: a task is not a compilation unit; it must be contained in a compilation unit generic template: a parametrized template for a package, function, or procedure that must be instantiated before it is used standard libraries: Ada has many of these; they are in the form of (generic or nongeneric) packages
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.