DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: ┃ A T ┃
Length: 4829 (0x12dd) Types: TextFile Names: »ADA_PARAM_DOC«
└─⟦85b835f43⟧ Bits:30000549 8mm tape, Rational 1000, Xlib rev 6.00 └─ ⟦0c20f784e⟧ »DATA« └─⟦1abbe589f⟧ └─⟦591c5b094⟧ └─⟦this⟧
------------------------------------------------------------------------------ -- Copyright 1989 - 1990 by Rational, Santa Clara, California. -- -- All Rights Reserved. -- -- Permission to use, copy, modify, and distribute this software and its -- documentation for any purpose and without fee is hereby granted, -- provided that the above copyright notice(s) appear in all copies and that -- both that copyright notice(s) and this permission notice appear in -- supporting documentation, and that the name of Rational not be used in -- advertising or publicity pertaining to distribution of the software -- without specific, written prior permission. -- -- Rational disclaims all warranties with regard to this software, including -- all implied warranties of merchantability and fitness, in no event shall -- Rational be liable for any special, indirect or consequential damages or -- any damages whatsoever resulting from loss of use, data or profits, whether -- in an action of contract, negligence or other tortious action, arising out -- of or in connection with the use or performance of this software. ------------------------------------------------------------------------------ Note: This document has been superceded by the manual, "Porting the Rational X Library" as of 08/13/90 Please refer to the new manual for complete documentation. Ada Parameterization Program --- ---------------- ------- Gary E. Barnes 06/06/89 The code for the X Library is intended to be "portable". This means that we make every attempt to isolate system, machine, and compiler dependencies. At the same time we would like to have a single set of Ada source files. This implies that we would like to have a tool that provides us with some type of conditional compilation that goes beyond whatever constant-expression evaluation or dead-code elimination that might be provided by a compiler. We need a way to write code that will not be "seen" by compilers that cannot (or will not) accept it. The Ada_Parm program provides that functionality. Ada_Parm works with Ada comments. For example, if you were preparing to compile the X Library for compilation on an R1000, then Ada_Parm would "comment out" any code that was targeted for some other computer and would "uncomment" (if necessary) any code that was specific to or required by the R1000 computer. Here is a quick example. If this code has been written: procedure foo is begin --/ if R1000 then --// Io.Put_Line( "We are here." ); --/ else --// Text_Io.Put_Line( "We are here." ); --/ end if; end foo; If this code was given to Ada_Parm with the parameter R1000 => TRUE then this would result. procedure foo is begin --/ if R1000 then Io.Put_Line( "We are here." ); --/ else --// Text_Io.Put_Line( "We are here." ); --/ end if; end foo; If this code was then fed back into Ada_Parm with the parameter R1000 => FALSE then the resulting code would be changed to: procedure foo is begin --/ if R1000 then --// Io.Put_Line( "We are here." ); --/ else Text_Io.Put_Line( "We are here." ); --/ end if; end foo; Ada_Parm looks for lines that begin with "--/" and it expects them to contain control constructs that tell Ada_Parm what to do. It also looks for lines that begin with "--//". These lines are Ada source code lines that will either be passed through as-is or which will be uncommented (the "--//" is removed). CONTROL CONSTRUCTS ------- ---------- Ada_Parm currently understands the following Ada-like control constructs. (Lines may begin with any number of spaces.) --/ if <expr> then --/ elsif <expr> then -- optional --/ else -- optional --/ end if; PARAMETERIZATION TYPES ---------------- ----- Ada_Parm currently understands parameters of the following types: BOOLEAN EXPRESSIONS ----------- Expression may span multiple lines; each new line begins with "--/". Ada_Parm currently understands the following expression operators (using Ada expression evaluation rules): NOT AND OR XOR AND THEN OR ELSE PARAMETERS ---------- Ada_Parm will produce an error message whenever it encounters a parameter name that it does not recognize. Parameter names are pre-defined by the Parameter_Definition routine from the Symbol_Table package. Parameter values are set either by the calling Ada program or by the user command line. On an R1000: Ada_Parm( Input => "Foo_Generic_Spec", Output => "Foo_Sun_Spec", Parms => "Sun=>TRUE,Unix=>TRUE" );