5. Embedded QUEL for Ada : Ada Variables and Data Types : Compilation Units and the Scope of Variables
 
Share this page                  
Compilation Units and the Scope of Variables
Type names and variable names are local to the closest enclosing Ada compilation unit. EQUEL/Ada compilation units include procedures, functions, package bodies and declaration blocks, all of which can be declared to EQUEL. The objects visible in the scopes include objects that are visible in the parent scope, formal parameters (if applicable) and local declarations. You cannot use the dotted notation to refer to hidden or ambiguous objects by prefixing the object with a subprogram or package name.
As in Ada, once the preprocessor has exited the scope, the variables are no longer visible and cannot be referenced. The Ada package specification is an exception to this visibility rule, because all the package specification contents are visible outside of the package.