Copyright c Xerox Corporation 1980Inter-Office MemorandumToMesa UsersDateOctober 27, 1980FromEd SatterthwaiteLocationPalo AltoSubjectMesa 6.0 Compiler UpdateOrganizationPARC/CSLXEROX Filed on: [Iris]Doc>Compiler60c.bravo, Compiler60d.bravo, and Compiler60.pressThis memo describes changes to the Mesa language and compiler that have been made since therelease of Mesa 5.0 (April 9, 1979).Definitions of syntactic phrase classes used but not defined in this document come from the MesaLanguage Manual, Version 5.0, Appendix F.CompatibilityBecause of changes in symbol table and BCD formats, you must recompile all existing Mesaprograms after obtaining recompiled versions of the interfaces and packages that they depend upon.Language ChangesOur goal for language compatibility has been to accept any valid Mesa 5 source program as a validMesa 6 source program. We are aware of the following incompatibilities:There are some new reserved words, as follows:FREE PRED PROC REJECT SEQUENCE SUCC UNCOUNTED ZONESome of the quoted file names that appear in DIRECTORY clauses have differentinterpretations. Text inside angle brackets is no longer ignored; it is treated as the name of alocal subdirectory (but we do not recommend using local subdirectories for Mesa programs atthe present time).The orders of evaluating the items in constructors (including argument lists) and the operandsof infix operators (except AND and OR) have changed somewhat. In particular, programs thatassumed a left-to-right order of procedure calls in these contexts (e.g., Divide[Pop[], Pop[]]) areunlikely to work correctly.The assignment operation is no longer available for updating objects containing MONITORLOCKor CONDITION values; updating of such objects must be done component-by-component.The granularity of packed arrays has changed. If the components of a packed array can bestored in four or less bits, the storage structures defined by the declaration of that array willdiffer between Mesa 5 and Mesa 6. This is a potential problem in reading files created byearlier versions of Mesa. Also, the DESCRIPTOR operator cannot be applied to packed arraysoccupying less than a word.!pX qp]g~ri cs]pX -s7Bp ]s]p-s7Bp Ys]t-s 7BpSup N#sFT Gp4' F$ B[w A p ;r 8p"sp. 63/ 2tX /hpa -HL+EX.B(sFGL&OpG-spHL$S L#[L!YL^L7spsp0L*wpwpwpLLm3s Lpsp)LKYL\LO LUs p,L =d  Mesa 6.0 Compiler Update2If you have been using type REAL, check with the supplier of your floating point package todetermine the effect of Mesa 6 changes in that area.Bug FixesA large number of Mesa 5 bugs have been fixed. The most notable of these involveexpansion of inline procedures that are defined in DEFINITIONS modules,expansion of inline procedures when an argument is itself an expanded inline,proper retention of the tag of a variant record within an arm of a discriminating selection,proper identification of object files that have been renamed.Because of certain bug fixes, the compiler may reject previously acceptable programs or may issuenew warning messages.As usual, the list of compiler-related change requests closed by Mesa 6.0 will appear separately aspart of the Software Release Description.Language RationalizationMesa 6 attempts to remove certain minor anomalies and to add some obvious generalizations to theexisting language.Syntactic Glitches RemovedList Punctuation: For most lists that are explicitly bracketed by symbols other than [ and ], theallowable forms are described by the following meta-BNF:list ::= empty | item | item separator listIn other words, the list may be empty or may be a sequence of items separated by, and optionallyterminated by, a separator. This rule now applies to the following constructs: form separator notesVariantList,CatchSeries;ANY must come lastChoiceSeries;ExitSeries;StatementSeries;StmtChoiceSeries;ChoiceList,ExprChoiceList,When the bracketing symbols are [ and ] or when the length of a list is significant, a trailingseparator is not allowed unless it is semantically meaningful (as in constructors and extractors), butempty lists are allowed. This change affects the following syntactic entities:UsingClause: The form USING [ ] is now permitted (e.g., to emphasize that an interface isonly being exported).VariantFieldList: In the declaration of a variant record, the form [ ] (empty brackets) maybe used instead of NULL (and is recommended). ftGLbpsp;L`v4 \TtX YpQLV3s pLTMLQ\LO= KD J# F6- E-) ?ri * [>N*Mesa 6.0 Compiler Update4New Language FeaturesExtended DefaultsYou can associate a default initial value with a type (not just with a field of a record). If a type isconstructed from other types using one of Mesa's type operators (e.g., RECORD), the default valuefor that type is determined by the default values of the component types and by rules associatedwith each operator. When you declare a named type, you have the option of explicitly specifying adefault for that type.With this extension, you will find that uses of defaults in Mesa generally fall into two classes.Default values for fields of records make the corresponding constructors more concise and moreconvenient to use. On the other hand, the usual reason for associating a default initial value with atype is to ensure that storage allocated for that type is well-formed, i.e., that any variable of such atype always has a meaningful value. There is some interaction between these uses; the default valueof a record type is partly determined by any default values specified for its fields, and a record fieldmay inherit its default value from the type of that field. The details appear below.The rules for inheritance of defaults are designed to provide the following property (currently notquite preserved by sequence or variant record types): if a type T has been given a non-NULL defaultvalue, any type derived from T will have a defined and non-NULL default value for any embeddedcomponent of type T. Because of the potential cascading effect implied by this, you shouldcarefully consider the relative costs and benefits of specifying a default, especially one that does notinclude NULL as an alternative.Defaults are ignored in determining equivalence and conformance of types. Thus it is possible tohave two compatible types with different default initializations.Specification of Default InitializationNone of the built-in types (INTEGER, CARDINAL, BOOLEAN, CHARACTER, STRING and REAL) has adefault initial value.The following rules determine the default initial value of a type designated by an expressioninvolving a type operator:The default initial value for a type constructed using RECORD (or ARRAY) is defined field-by-field (or element-by-element). For each field (element), it is the default value for that field ifthere is one; otherwise, it is the default initial value for the type of that field (element) or isundefined if there is no such default.The default initial value for any port type, constructed using PORT, is NIL (see below).Types constructed using other operators have no implied default initialization.The default initial value of a type designated by a declared type identifier T depends upon the formof the declaration of T, as follows:T: TYPE = TypeExpr; T receives all the attributes of TypeExpr including any default.T: TYPE = TypeExpr _ e; T receives all the attributes of TypeExpr except that its default initial value is e. ftG ari ]tX Zfp#E XGsp  WE UpO S Pz;& NM M,&@ K,< I Y H6%C FU C@ V A%wpsp ?wp sp >Jwp > <Z :sp 7#> 6A 2wX' /hpspspspspspsp - *r1, (L&OspspL$ZL#@#L!Y&LX?spsp LcO A wp mwp @wpXspwp@wwpwp@wpspwpwp@ wpwp*wp :>ZLMesa 6.0 Compiler Update5ExamplesFlag: TYPE = BOOLEAN _ FALSE;Rec1: TYPE = RECORD [f: Flag];-- default value is [f: FALSE]Rec2: TYPE = RECORD [f: Flag] _ [ ];-- ditto (the field defaults)Rec3: TYPE = RECORD [f: Flag] _ [TRUE];-- explicit defaultRec4: TYPE = Rec3;-- default value is [f: TRUE]Rec5: TYPE = Rec3 _ [f: FALSE];-- default value is [f: FALSE]Any DefaultSpecification is acceptable in a type declaration (see Mesa Language Manual, Version5.0, page 37). A declaration giving a type T a NULL default cannot, however, equate T to a typewith a default that does not include NULL. A default appearing in a type definition within aDEFINITIONS module must be either NULL or an expression with a compile-time constant value.Default values associated with types are usedto initialize local variables of procedures and programs, in the absence of explicit initialization,to initialize variables that are dynamically allocated using NEW, in the absence of explicitinitialization (see below),to construct records (except argument and result records), in the absence of an explicit valuefor a field in the constructor and of a default value for that field in the record declaration,to construct arrays, in the absence of an explicit value for an element (see below).Defaults in Argument and Result RecordsYou may specify default values for the fields of argument and result records. Such default valuesmust be constructed from constants or variables that are declared outside of the procedure typedefinition. In particular, you cannot use a value of another field of the same record or, in the caseof a result record, a value from the associated argument record to define such a default. You may omit a field in the constructor of an argument or result record only if the definition ofthat record specifies an explicit default value for the field; default initial values associated with thetypes of such fields are not inherited (for example, this protects you from assigning a value to areturn variable and then forgetting to mention it in a RETURN statement, causing the default for itstype to be returned). On the other hand, protection against ill-formed storage is inherited; you maynot void or elide a field unless the type of that field allows a NULL initialization. Any defaults that you specify in the declaration of a result record serve two purposes. Since thefields of such a record can be used as local variables within the procedure body, a defaultspecification affects the initialization of those variables; in addition, it allows abbreviation in theconstructors of the corresponding return records. The precise rules are the following:Upon entry to a procedure, each field of the result record is initialized with the default valuespecified for that field, if any; otherwise, with the default initial value for the type of thatfield, if there is one; otherwise, its initial value is undefined.If a RETURN is followed by an explicit constructor, the default specifications appearing in thedeclaration of the result record control the values of any omitted or elided fields, even if otherassignments have been made to the result variables within the procedure body. If the RETURNstands by itself, without such a constructor, or if the RETURN is implicit, the return record isconstructed using the current values of the result variables. ftG bw@_pXspspsp@]wpspspwp.wsp@\Twpspspwp.@Zwpspspwpsp.@Ywpspwp.wpsp@W^wpspwpwsp.wpsp Txp'w Rhp!wpsp!wp P%sp ( Os psp5 KX-LIP<(LF&spLE-LBILA 9&L>T ;AwX' 7p=% 6K/0 4f 2Z / S .U ,_wpwp. *7sp  )7wp 'iAsp $b "s@ g %WLZLDL[BLsp9L9LwpwL8psLp- sp"LC>  =XMesa 6.0 Compiler Update6ExamplesT: TYPE = INTEGER _ 1;Proc1: PROC [i: INTEGER _ 0, j: T];Proc2: PROC RETURNS [m: T, n: INTEGER _ 2] = { -- m initialized to 1 (from T), n to 2 Proc1[j: 3];-- Proc1[i:0, j:3]; Proc1[i: 3];-- illegal (j does not default to 1) ... m _ 4; n _ 5; ... RETURN;-- returns [4, 5] ... RETURN [m, n];-- also returns [4, 5] ... RETURN [m];-- returns [4, 2] ... RETURN [NULL, n];-- illegal (declaration of T disallows voiding of m) ... RETURN [, n];-- ditto (m does not default to 1 or 4) ... RETURN [6, 7];-- returns [6, 7] ... };-- implicitly returns [4, 5]Defaults and Variant RecordsYou may specify a default for the entire variant part in the declaration of a variant record type. Inthe absence of such a specification, the default value of that part, including the tag, is undefinedwith respect to the undiscriminated record type.The default initial value of a discriminated variant record type has a tag value corresponding to thediscriminating adjective, and defaults for the other fields of the variant part are those implied by thefields selected by that tag. In particular, the declaration or allocation of a variable with discriminated record typesets the tag correctly.ExampleVRec: TYPE = RECORD [ common: INTEGER _ 0, variant: SELECT tag: * FROM red => [r1: BOOLEAN _ FALSE], green => [g1: INTEGER _ 0] ENDCASE _ red[TRUE] | NULL];v: VRec;-- initial value is [common: 0, variant: red[r1: TRUE]]v1: VRec _ [common: 10];-- initial value is [common: 10, variant: red[r1: TRUE]]v2: VRec _ [variant: NULL];-- tag and variant part are undefined, v2.common = 0v3: VRec _ NULL;-- illegal (declaration of common does not allow NULL)rv: red VRec;-- initial value is [common: 0, variant: red[r1: FALSE]]gv: green VRec;-- initial value is [common: 0, variant: green[g1: 0]]Defaulted Array ElementsElements in an array constructor may be voided or elided. Omission of elements is permitted in akeyword constructor (see below) but not in a positional constructor. The empty constructor ([ ]) is akeyword constructor with all items omitted. An elided or omitted element receives the default valuefor the type of the components of the array (if any); the value of a voided element is undefined.ALL abbreviates a positional constructor of the appropriate length; thus ALL[ ] elides all elements(defaulting if possible) and ALL[NULL] voids all positions. ftG bwL_pXspspL](wpspwpspwpwpLZwpspspwpwpwpspLYwpwpwpwpLW^wpwp wpwpwpLUwpwp wpLTLRhwpwpLPsFp XLOsFpXwpwp LMrsFpXwp LKsFpXspwp wpwpLJ#sFpXwp' wpwpLH|sFpX LF  Cw @7p51 >O <0 941 7K 6Kv1* 4 1wL/!pXspspL-zwpspL+wpspwpsL*+pwpwpspspL(wpwpspL&spwpspspL$awpwp wpwpwpwpspL"wpwpwp wpwpwpwpspL!wpwpwpsp 'wpwpLkwpwpsp wpspLwpwp wpwpwpwpspLwpw p wpwpwpwp w p.3 #C 1"B B ;sp8 sp spsp L=\Mesa 6.0 Compiler Update7Keyword Array ConstructorsYou can use keyword array constructors when the index type of the array is an enumeration orsubrange thereof. The acceptable keywords are the constants appearing in the enumeration. In thecase of a subrange, the endpoints must be defined by expressions involving only those constants, theoperators FIRST, LAST, SUCC and PRED, and identifiers equated by declaration to such expressions.If the component type of the array has a defined default value (including NULL), keyword items canbe omitted; the corresponding elements receive the default value.Packed ArraysIf you specify the PACKED attribute for an array type, the granularity of packing is 1, 2, 4, 8 or 16nbits and is determined by the component type of the array (formerly just 8 or 16n bits).The value of the construct SIZE[T, n] is the size, in words, of the storage required by a packed arrayof n items of type T. (SIZE[T] continues to yield the number of words occupied by a single item oftype T.)ExampleBit: TYPE = BOOLEAN _ FALSE;BitSet: TYPE = PACKED ARRAY Color OF Bit;AllBits: BitSet = ALL[TRUE];threeBits: BitSet _ [yellow: TRUE, red: TRUE, blue: TRUE]; Successor and Predecessor OperationsThe operators SUCC and PRED operate upon values of any ordered type except REAL. For numericand character types, SUCC[x] and PRED[x] are equivalent to x+1 and x1 respectively. Forenumerated types, the values are the successor and predecessor of x in the enumeration; a boundsfault occurs if there is no such element and you requested bounds checking.DirectoriesYou can now override the association established by the DIRECTORY clause between the names ofincluded modules and the names of the files containing those modules. Any file names implied byconvention can be omitted entirely; they will be computed from the interface identifiers.SyntaxIncludeList::=IncludeItem|IncludeList , IncludeItemIncludeItem::=identifier UsingClause|identifier : FROM FileName UsingClause|identifier : TYPE UsingClause|identifier : TYPE identifier UsingClauseUsingClause::=empty | USING [ IdList ] | USING [ ]The (initial) identifier in an IncludeItem names a module. If you specify the name of the filecontaining that module when you invoke the compiler (as a keyword parameter with keywordidentifier, see below), that name is used, even if a FileName appears in the IncludeItem.Otherwise, if such a FileName appears, it is used. If you supply neither a compile-time argumentnor a FileName, the name identifier.bcd is used. ftG bX ^p:" ](I [U Y spspspsp= X22sp VA RhtX Opsp;w Mrp/!wp J#spwpwp> H|wpwpspwp( Fwp CwLA pXspspspL?dwpspsF pXwpspwpL=wpwpspspL<w pwpwspwpspwpsp 7t$ 4p spsp(sp 2spwpspwpwpwp 1U-wp /)wp +t (=p7sp &` $Y "swLx p'x Q'XL p'x /' sx ' sx ' sxLe p'xsx sx p x px p5 o7! x pxpx p xp' yxp y p 2>]Mesa 6.0 Compiler Update8One approach to describing systems built from collections of Mesa modules views the DIRECTORYclause as the declaration of (compile-time) formal parameters of type TYPE. Mesa 6 provides thefinal two forms of IncludeItem primarily for compatibility with this view. The identifier precedingthe colon names the formal parameter; it is also used to derive a file name as described above. Theidentifier following TYPE constrains the set of acceptable actual parameters; it must match theModuleName used in the definition of the module that you intend to include (see the MesaLanguage Manual, Version 5.0, Section 7.2).You can use the final form to change the name by which one module is known within another,notably to avoid duplicate names in a DIRECTORY clause. For example, you might need to referencetwo different versions or parameterizations of an interface Defs within a single program. TheIncludeItemsLongDefs: TYPE Defs,ShortDefs: TYPE Defsdeclare LongDefs and ShortDefs as identifiers within that program of possibly different modules,each with the ModuleId Defs. As IncludeItems, the formsidentifieridentifier: TYPEeach abbreviateidentifer: TYPE identifierand the name in the DIRECTORY must be identical to the ModuleId if you use one of these forms.Implicitly Imported InterfacesAn implicitly imported interface is one from which imported values are required for binding thefree variables of another, explicitly imported interface. For example, interface D1 might importinterface D2 to gain access to a procedure or exported variable supplied by the latter. D2 is thenimplicitly imported by any program module M that imports D1 (see the Mesa Language Manual,Version 5.0, Section 7.4.4).In Mesa 6, the free variables of D2 that are used by D1 are bound to the principal instance of D2 inM. An import is a principal instance if it is the only instance of that interface imported by amodule or if it is unnamed. Furthermore, if M imports no instances of D2, a principal instance willbe created automatically. If module M has no other reason to mention D2, D2 then need notappear in either the DIRECTORY or the IMPORTS list of M. Explicitly importing a principal instanceof D2 in such a situation is not an error, and you must do so ifyou plan to use positional notation to specify the imports of M in a C/Mesa configurationdescription, since the positions of automatically created interface instances are not defined, oryou already import more than one instance of D2, each of which is named.In a C/Mesa configuration, principal instances of interfaces are not supplied automatically; you must import themexplicitly if they cross (sub)configuration boundaries. ftG bp"2s `vpEsp ^x px p ](04 [x p sp< Yx pIw X2p T6$ S<%sp2 Q&wp Ox pLMrwpXspwLK pspw IPpwpwp, G xpwpx p LE-w LC pXs A pL>w pspw <pspxp 7t 4p_ 2 Dwp 1U wp!,wp /wp wp w . p *!wpwpwpwp )wp*5 'iwp$wpwp %$wpwpwp $ spspwp, "swp;L>wpLQAL-wp vAzv '8p =Q+`Mesa 6.0 Compiler Update9Real NumbersMesa 6 has adopted the proposed IEEE standard for floating-point arithmetic (see, e.g., Coonen, Animplementation guide to a proposed standard for floating-point arithmetic, Computer, January 1980,pp. 68-79). In support of this, the language provides floating-point literals and the compilerperforms a limited number of operations upon floating-point constants.Syntaxprimary::=... | realLiteralrealLiteral::=unscaledReal|unscaledReal scaleFactor|wholeNumber scaleFactorunscaledReal::=wholeNumber fraction| fractionfraction::=. wholeNumberscaleFactor::=E optSign wholeNumber | e optSign wholeNumberoptSign::=empty | + | wholeNumber::=digit | wholeNumber digitAn unscaledReal has its usual interpretation as a decimal number. The scaleFactor, if present,indicates the power of 10 by which the unscaledReal or wholeNumber is to be multiplied toobtain the value of the literal.Mesa 6 represents REAL numbers by 32 bit approximations as defined in the IEEE standard. Therounding mode used to convert literals is "round-to-nearest." A literal that overflows the internalrepresentation is an error; one that underflows is replaced by its so-called "denormalized"approximation. In Mesa 6, the value of the unscaledReal in a literal must be a valid LONGINTEGER when the decimal point is deleted.No spaces are allowed within a realLiteral. Note that such a literal can begin, but not end, with adecimal point. Thus the interpretation of [0...1) is unambiguous (but perhaps surprising; use [0 .. .1)or [0.0..0.1) instead).OperationsThe compiler performs the following operations involving floating-point constants:Unary negation (with 0 = 0)ABSFixed-to-Float (in "round-to-nearest" mode).Other operations are deferred until runtime, even if all their operands are constant, so that theprogrammer can control the treatment of rounding and exceptions (see the proposed standard).Unless you specify the compilation option -f (see below), the compiler generates instructions for floating-pointoperations that require hardware or microcode support. If you are in doubt about the state of your machine orits microcode, see a local floating-point expert. ftG bX ^p-5 ](Kwp [ S YF W^wLTx p'xXLRh p'x P' O'LL p'x Jp'xLH| p'x LF '-LC ' LA ' =px p4x p <'x px p :n 7spG 5xG 3 B  2),x ps 0p# -3x p) +*> ) &w #GpRL XxpL%sL}p, a [?Lv,DLkLB1 =SMesa 6.0 Compiler Update10Machine Dependent EnumerationsSometimes a programmer can enumerate the values of some type but requires control of theencoding of each value or of the number of bits used to represent the type (usually for futureexpansion). Mesa 6 provides machine-dependent enumerations for such applications.SyntaxEnumerationTC::=MachineDependent { ElementList }MachineDependent::=empty | MACHINE DEPENDENTElementList::=Element | ElementList , ElementElement::=identifier|identifier ( Expression )|( Expression )ExamplesStatus: TYPE = MACHINE DEPENDENT {off(0), ready(1), busy(2), finished(4), broken(7)}Color: TYPE = MACHINE DEPENDENT {red, blue, green, (255)}-- reserve 8 bitsEach Expression in an EnumerationTC must denote a compile-time constant, the value of which isan unsigned integer.In an enumerated type with the MACHINE DEPENDENT attribute, the values used to represent theenumeration constants are assigned according to the following rules. If a parenthesized expressionfollows the element identifier, the value of that expression is used; otherwise, the representation ofan element is one greater than the representation of the preceding element. If you specify only arepresentation, the corresponding element (normally a place holder) is anonymous. If therepresentation of the initial element is not given, the value zero is used.You cannot explicitly specify the representation of any element unless the attribute MACHINEDEPENDENT appears in the type constructor. Two element identifiers cannot be represented by thesame value (either given explicitly or determined implicitly as described above). The ordering ofelements determined by position in the ElementList must agree with the ordering determined bythe (unsigned) arithmetic ordering of the representations.Sparse EnumerationsA machine-dependent enumerated type is sparse if there are gaps within the set of values used torepresent the constants of that type or if the smallest such value is not zero. Mesa 6 takes thefollowing position on gaps: they are filled by valid but anonymous elements of the enumeratedtype. These elements can be generated only by the operators FIRST, SUCC and PRED (or by theiteration forms that implicitly use these operators).If you use a sparse enumerated type as the index type of an array, the array itself will havecomponents for all elements of the enumeration, including the anonymous ones. The latterare awkward to access (except through ALL) and may cause problems in constructors,comparison operations, etc., as well as wasted space. (For example, ARRAY Color OF INTEGERwould occupy 256 words.) ftG? bX ^p> ](N [R YwLVx p'xpXx pLTx p'xsFLQx p'xpXx pxLO p'x Mrp'x px p K'x p IPwLFpspsFpXwpwpwpwpwpLDZwpspsFpXwpwpwp5 A x px p; ?d <sp, :nE 8<* 7 X 5x R  3K 03"s .pS -3J +&x p+ ): &wX #Gp'wp & ! T N Q!spspsp 5L/S LYLsp)L9EspwpsLp D J=TaMesa 6.0 Compiler Update11Machine Dependent RecordsMachine-dependent records are provided for situations in which the exact position of each field isimportant. In Mesa 6, you can explicitly specify word- and bit-positions in the declaration of therecord type. This form provides better documentation and usually is easier to use than theprevious, purely positional form. You should use it in preference to the old form, which remainsfor compatiblity.SyntaxVariantFieldList::=CommonPart FieldId : Access VariantPart|VariantPart|NamedFieldList|UnnamedFieldList|emptyCommonPart::=NamedFieldList , | emptyNamedFieldList::=NamedField | NamedFieldList , NamedFieldNamedField::=FieldIdList :Access TypeSpecification DefaultOptionFieldIdList::=FieldId | FieldIdList , FieldIdFieldId::=identifier | identifier ( FieldPosition )Tag::=FieldId | ...FieldPosition::=Expression : Expression .. Expression|ExpressionExamplesInterruptWord: TYPE = MACHINE DEPENDENT RECORD [ channel (0: 8..10): [0..nChannels),-- nChannels <= 8 device (0: 0..7): DeviceNumber, stopCode (0: 11..15): MACHINE DEPENDENT {finishedOK(0), errorStop(1), powerOff(3)}, command (1: 0..31): ChannelCommand];Node: TYPE = MACHINE DEPENDENT RECORD [ type (0: 0..15): TypeIndex, rator (1: 0..13): OpName, rands (1: 14..47): SELECT valence (1: 14..15): * FROM nonary => [], unary => [left (1: 16..31): POINTER TO Node], binary => [left (1: 16..31), right (1: 32..47): POINTER TO Node] ENDCASE]An identifier with an explicitly specified FieldPosition can occur only in the declaration of a fieldof a record defined to have the MACHINE DEPENDENT attribute. If the position of any field of arecord is specified, the positions of all must be. Each Expression in a FieldPosition must denote acompile-time constant, the value of which is an unsigned integer.The first expression appearing in a FieldPosition specifies the (zero-origin) record-relative index ofthe word containing the start of the field; the second and third specify the indices (zero-origin) ofthe first and last bits of the field with respect to that word. The second and third expressions mayspecify a bit offset greater than the word size if the word offset is adjusted accordingly. Similarly,the difference between the second and third expressions may exceed the word size. If the bit ftG? bX ^pQ ](): [[ Y!@ X2 UwLS p'x px px pL<x p'xpxL9 p'x px px 7p'x 4wL2) pspsFpXL0wpwp'wpL.wp w pL-3wp sFpXw pwpwpL+wp w pL)wpspsFpXL'iwp wpL%wp wpL$wp spwpsL"spwpL wpwp sF pXwpL%wpwp wp sF pXwpL}sp /+x p- spsp # "x px p 9A $x p5 CE @% 25 M] > =]Mesa 6.0 Compiler Update12positions are not specified, a specification of 0..n*WordSize-1 is assumed, where n is the minimumnumber of words required by the type of the field.Each field must be at least wide enough to store any value of the corresponding type. Values arestored right-justified within the fields. The current implementation of Mesa imposes the followingadditional restrictions on the sizes and alignment of fields:A field smaller than a word (16 bits) cannot cross a word boundary.Any field occupying a word or more must begin at bit zero of a word and have a size that isa multiple of the word size.A variant part may begin at any bit position (as determined by its tag field).If the sizes of all variants of a record type are less then a word, those sizes must be equal;otherwise, the size of each variant of the type must be a multiple of the word length.In the definition of a machine-dependent record type, explicitly specified field positions must notoverlap. For a variant record type, this requirement applies to the variant part (including the tag)considered in conjunction with the fields of the common part; the tag and fields particular to eachvariant must lie entirely within the variant part.The order of fields in a record type declaration need not agree with the order of those fields in therepresentation of the record; however, no gaps are permitted. For variant records, the fields of atleast one variant (including the tag field) must fill the position specified for the variant part.Dynamic Storage AllocationIn Mesa 6, you can use special constructs to describe the dynamic allocation and deallocation ofvariables. You are still responsible for managing the storage and guarding against danglingpointers; the new features handle certain routine aspects of allocation and deallocation (such ascomputing sizes), provide proper default initialization of newly allocated variables, and reduce thetotal number of LOOPHOLEs required to deal with an allocator. ZonesAllocation and deallocation are done with respect to zones. A zone need not be associated with anyspecific storage area; it is just an object characterized by procedures for allocation and deallocationas described below. The storage managed by a zone in Mesa 6 is said to be uncounted. In suchzones, object management is the responsibility of the programmer, who must explicitly program thedeallocation.To use an uncounted zone, you must provide the procedures that manage the zone and implementthe required set of operations. Many users will be able to import a suitable implementation from astandard package; the details of writing such packages are discussed below.A zone object has a value and a type. You will normally obtain a zone value by calling aprocedure exported by some package implementing zones. Typically, such a procedure constructs azone (and perhaps an initial storage pool) according to user-supplied parameters.The type of a zone value must belong to a new class of types, called zone types. Mesa 6 providestwo such types, UNCOUNTED ZONE and MDSZone. Transactions with objects having these types aregenerally in terms of LONG POINTER and POINTER values respectively (see below). ftG? bp3w pwp `v2 ](F [*9 Y=LW^CLT4'LS<LPNLNF1-LL/' IP] GG FE DZ2 A O ?dB" =b 9tX 6Kp9' 4S 2X 1U:* /sp' ,_w )p5wp' 'iQ %:wp $I "s %C }03 K &3 I 9Q D Cs pwp/ s psp! T=Y.Mesa 6.0 Compiler Update13Syntactically, UNCOUNTED ZONE is a type constructor. MDSZone is a predeclared identifier; you may think of it as asynonym for MDS RELATIVE UNCOUNTED ZONE (which you currently cannot write directly).You may declare variables having zone types (for which fixed initialization is recommended). Zonetypes may also be used to construct other types. In particular, you may choose to deal with pointers to zones;the NEW and FREE constructs described below provide automatic dereferencing. Allocating StorageThe operator NEW allocates new storage of a specified type, initializes it appropriately, and returns apointer to that storage. The NEW operation is considered an attribute of a zone, which must bespecified explicitly.SyntaxPrimary::=...|Variable . NEW [ TypeSpecification Initialization OptCatch ]|( Expression ) . NEW [ TypeSpecification Initialization OptCatch ]Initialization::=empty | _ InitExpr | = InitExprOptCatch::=empty | ! CatchSeriesThe value of the Variable or Expression identifies the zone to be used, either directly or after anarbitrary number of dereferencing operations. The TypeSpecification determines the type of theallocated object. If an InitExpr is provided, it must conform to the specified type and its value isused to initialize the new object; otherwise, the default value associated with that type (if any) isused. Only signals raised or propagated by the allocation procedure activate a CatchSeriesattached to NEW.The value of the Primary is a pointer to the newly allocated object. The type of that pointerdepends upon the type of the zone and the form of the Initialization. If the argument of NEW issome type T, the type of the result isLONG POINTER TO T, if the type of the zone is equivalent to UNCOUNTED ZONEPOINTER TO T, if the type of the zone is equivalent to MDSZone.If you specify fixed (=) initialization, the result is a read-only pointer with type LONG POINTER TOREADONLY T or POINTER TO READONLY T respectively.The InitExpr cannot be the special form for string body initialization ([ Expression ]). You can,however, allocate string bodies with dynamically computed sizes by using a new form ofTypeSpecification (see below). If you do so, the Initialization must be empty.Releasing StorageUncounted zones have FREE operations. When applied to an object, this operation releases thestorage allocated for that object.SyntaxStatement::=...|Variable . FREE [ Expression OptCatch ]|( Expression ) . FREE [ Expression OptCatch ]The zone used in a FREE operation is determined as described for NEW; it should be the zone fromwhich the variable was originally allocated. The argument of FREE is the address of a pointer to thevariable to be deallocated; FREE sets the pointer to NIL and deallocates the storage for the variable. ftG? bAvsvsvzv6 ` zvsv- ]p\ \2v+ Zfsvsv=p WwX Sp spW R"sp> Pz MwMKxp cxIp cxpXspxpx pxpH6 cx pspxpx pxpMEx p cxpxpxMC@p cxpx ?pxpx p( >J-xp <xpD :K 9T:x 7p sp 4^xp 9 2!x psp 1 wpL.sFpXwp+sFL, pXwp+wp )As 'pwpspwp $xp:x p #B !Yxp!x p  wX psp, " wLxp w xpXsxp x pspx pxp sp*sp >spwp 3 spsp. =^Mesa 6.0 Compiler Update14Only signals raised or propagated by the deallocation procedure activate a CatchSeries on a FREE.Implementing Uncounted ZonesThis section describes the assumptions currently made by the compiler about the user-suppliedimplementations of uncounted zones. These assumptions are compatible with the style of "object-oriented" programming that has proven successful in a number of applications. You need to readthis section only if you are designing the interface between a storage management package and thezone features of the language.An uncounted zone dealing with LONG POINTER values is represented by a two word value, whichthe compiler assumes to be a long pointer compatible with the following skeletal structure:UncountedZoneRep: TYPE = LONG POINTER TO MACHINE DEPENDENT RECORD [ procs (0:0..31): LONG POINTER TO MACHINE DEPENDENT RECORD [ alloc (0): PROC [zone: UncountedZoneRep, size: CARDINAL] RETURNS [LONG POINTER], dealloc (1): PROC [zone: UncountedZoneRep, object: LONG POINTER] -- possibly followed by other fields-- ], data (2:0..31): LONG POINTER-- optional, see below -- possibly followed by other fields-- ];If z is an uncounted zone, the code generated for p _ z.NEW[T] is equivalent top _ z^.procs^.alloc[z, SIZE[T]]and the code generated by z.FREE[@p] is equivalent to{temp: LONG POINTER _ p; p _ NIL; z^.procs^.dealloc[z, temp]}.Within this framework, you may design a representation of zone objects appropriate for yourstorage manager. In general, you should create an instance of a finger (the record with fields procsand data) for each instance of a zone. The record designated by the procs pointer can be shared byall zones with the same implementation. The data pointer normally designates a particular zoneand/or the state information characterizing that zone. Note that the compiler makes no assumptionsabout the designated object and does not generate any code referencing the data field. The extralevel of indirection provided by that field is not obligatory; you may replace it with stateinformation contained directly in the finger (but following the procs field).The compiler assumes a similar (but single word) representation for an MDSZone value; theskeletal structure is as follows: MDSZoneRep: TYPE = POINTER TO MACHINE DEPENDENT RECORD [ procs (0:0..15): POINTER TO MACHINE DEPENDENT RECORD [ alloc (0): PROC [zone: MDSZoneRep, size: CARDINAL] RETURNS [POINTER], dealloc (1): PROC [zone: MDSZoneRep, object: POINTER] -- possibly followed by other fields-- ], data (1:0..15): POINTER-- optional -- possibly followed by other fields-- ]; ftG? bpKx psp ^wX [pG YT X20/ VI T Qs p1 ODLMrwpXspsF$pXLKwp sF*LJ#pXw pspwpwpwpspspsFpLH|Xw pspwpwpwpsFpXspLFwp)LE-wp sF .pXLC- @7wp.wpwpspwpL=wpwpwpwpwpspwp ;AwpspwpL8wpsF pXwpwpspwpwpwpwpwp 5x= 3Awp w 2)pwpU!Mesa 6.0 Compiler Update16SeqTag ::=identifier : Access BoundsType |COMPUTED BoundsTypeBoundsType ::=IndexTypeTypeSpecification ::=. . . |TypeIdentifier [ Expression ]The TypeSpecification in VariantPart establishes the type of the sequence elements. TheBoundsType appearing in the SeqTag determines the type of the indices used to select from thoseelements. It is also the type of a tag value that is associated with each particular sequence object toencode the length of that object. For any such object, all valid indices are smaller than the value ofthe tag. If T is the BoundsType, the sequence type is effectively a union of array types with theindex typesT[FIRST[T] .. FIRST[T]), T[FIRST[T] .. SUCC[FIRST[T]]), ... T[FIRST[T] .. LAST[T])and a sequence with tag value v has index type T[FIRST[T]..v). Note that the smallest interval in thisunion is empty.If you use the first form of SeqTag, the value of the tag is stored with the sequence and isavailable for subscript checking. In the form using COMPUTED, no such value is stored, and nobounds checking is possible.Examples:StackRep: TYPE = RECORD [ top: INTEGER _ 1, item: SEQUENCE size: [0..LAST[INTEGER]] OF T]Number: TYPE = RECORD [ sign: {plus, minus}, magnitude: SELECT kind: * FROM short => [val: [0..1000)], long => [val: LONG CARDINAL], extended => [val: SEQUENCE length: CARDINAL OF CARDINAL] ENDCASE]WordSeq: TYPE = RECORD [SEQUENCE COMPUTED CARDINAL OF Word]The final example illustrates the recommended method for imposing an indexable structure on raw storage.If S is a type containing a sequence field, and n is an expression with a type conforming toCARDINAL, both S and S[n] are TypeSpecifications. They denote different types, however, and thevalid uses of those types are different, as described below.MACHINE DEPENDENT SequencesYou may declare a field with a sequence type within a MACHINE DEPENDENT record. Such a fieldmust come last, both in the declaration and in the layout of the record, and the total length of arecord with a zero-component sequence part must be a multiple of the word length. If youexplicitly specify bit positions, the size of the sequence field also must describe a zero-lengthsequence; i.e., it must account for just the space occupied by the tag field (if any). fpG?LbuqX u ququ `vqu tqu L] q uLYq uX2qu qu q Tuqu q Scardinality(Ti), and you have requested bounds checking.If FIRST[Ti] = 0, SUCCn[FIRST[Ti]] is just n, i.e., the interpretation of the tag is most intuitive if Ti isa zero-origin subrange. Usually you will specify a BoundsType (e.g., CARDINAL) with a range thatcomfortably exceeds the maximum expected sequence length. If, however, some maximum lengthN is important to you, you should consider using [0..N] as the BoundsType; then the value of thetag field in a sequence of length n (n < N) is just n and the valid indices are in the interval [0..n). fpG? bqL^rqXtqtFqXL](rq tqL[rq tqrqtF qXrqLX2rqtqtFqXLVrqtqLTrqtFqXtFqXtF q QrX NFqrq&rqrq L3rqrq Jtqrq* IP'7tq G)tq"rqrq F; B tqrqrq tq' A rqrq! =rqtqrqrq t qrqtqrq <rq0tqrqrq :n rq+L7XIL5x*t6s5xqtqrq rqL28 /^rq . tqO ,_42 *O t )q %L#GrqXtFqXrqrqtqrq.rqrqL rqtF qXrqtqrqrqrqrqrqtqLQrqtF qXrqrqtqrqrq  rqR [tqu qrs[quq 'ts'qtqrs'q@rs'q rqv \r qrs\qrq$ 1tqrs1qts1qtqrs1q rq;rs1q fu qtq T rq4rqu q p rqrqvqrq rq/rq )=\Mesa 6.0 Compiler Update18Operations on SequencesYou can use a sequence-containing type S only as the argument of the type constructor POINTER TO.Note that the type of z.NEW[S[n]] is POINTER TO S (not POINTER TO S[n]). If the type of an objectis S, the operations defined upon that object areordinary access to fields in the common partreadonly access to the tag field (if not COMPUTED)indexing of the sequence fieldconstructing a descriptor for the components of the sequence field (if not COMPUTED).There are no other operations upon either type S or the sequence type embedded within S. Inparticular, you cannot assign or compare sequences or sequence-containing records (except byexplicitly programming operations on the components).Indexing: You may use indexing to select elements of the sequence-containing field of a record byusing ordinary subscript notation, e.g., s.seq[i]. The type of the indexing expression i must conformto the BoundsType appearing in the declaration of the sequence field and must be less than thevalue of the tag, as described above. The result designates a variable with the type of the sequenceelements. A bounds fault occurs if the index is out of range, the sequence is not COMPUTED, andyou have requested bounds checking.By convention, the indexing operation upon sequences extends to records containing sequence-valued fields. Thus you need not supply the field name in the indexing operation. Note too thatboth indexing and field selection provide automatic dereferencing.Examples:ps^.item[ps.top] ps.item[ps.top] ps[ps.top] -- all equivalentDescriptors: You may apply the DESCRIPTOR operator to the sequence field of a record; the result isa descriptor for the elements of that field. The resulting value has a descriptor type with index andcomponent types and PACKED attribute equal to the corresponding attributes of the sequence type.By extension, DESCRIPTOR may be applied to a sequence-containing record to obtain a descriptor forthe sequence part. The DESCRIPTOR operator does not automatically dereference its argument.You cannot use the single-argument form of the DESCRIPTOR operator if the sequence is COMPUTED.The multiple-argument form remains available for constructing such descriptor values explicitly (andwithout type checking).In any new programming, you should consider the following style recommendation: use sequence-containing types forallocation of arrays with dynamically computed size; use array descriptor types only for parameter passing.Examples:DESCRIPTOR[pn^] DESCRIPTOR[pn.sons] -- equivalentString Bodies and TEXTThe type StringBody provided by previous versions of Mesa illustrates the intended properties anduses of sequences. For compatibility reasons, it has not been redefined as a sequence; thedeclarations of the types STRING and StringBody remain as follows: fpG? br ^q'rq.t q ](rqtqrqrqt qrqt qrqrq [rq-LYX,LV)tqLTLQKtq NF/rq&rq L2* J5 Grq L F)rqrqrq&rq DZu qM BT A Ktqr ?dq# <4( :n># 8B 5x2rqrqrqrqXrqrqrqrqrqrqrq /r q t q: .f ,_tq0 * t qC )t q1 %/t qtq $=' "s Hsq k qAt qrqXt qrqrq p qr qJ )W tqr q 2 :>Z`Mesa 6.0 Compiler Update19STRING: TYPE = POINTER TO StringBody;StringBody: TYPE = MACHINE DEPENDENT RECORD [ length (0): CARDINAL _ 0, maxlength (1): --READONLY-- CARDINAL, text (2): PACKED ARRAY [0..0) OF CHARACTER]The operations upon sequence-containing types have, however, been extended to StringBody so thatits operational behavior is similar. In these extensions, the common part of the record consists ofthe field length, maxlength serves as the tag, and text is the collection of indexable components(packed characters). Thus z.NEW[StringBody[n]] creates a StringBody with maxlength = n andreturns a STRING; if s is a STRING, s[i] is an indexing operation upon the text of s, DESCRIPTOR[s^]creates a DESCRIPTOR FOR PACKED ARRAY OF CHARACTER, etc.There are two anomalies arising from the actual declaration of StringBody: s.text[i] never uses bounds checking,and DESCRIPTOR[s.text] produces a descriptor for an array of length 0. Use s[i] and DESCRIPTOR[s^] instead.Type TEXTThe type TEXT, which describes a structure similar to a StringBody as a true sequence, is predeclaredin Mesa 6. Its components length and maxLength are declared to have a type compatible witheither signed or unsigned numbers (but with only half the range of INTEGER or CARDINAL).TEXT: TYPE = MACHINE DEPENDENT RECORD [ length (0): [0..LAST[INTEGER]] _ 0, text (1): PACKED SEQUENCE maxLength (1): [0..LAST[INTEGER]] OF CHARACTER]Exported TypesAn exported type is a type designated by an identifier that is declared in an interface andsubsequently bound to some concrete type supplied by a module exporting that interface. This isanalogous to the current treatment of procedures in interfaces, where the implementations ofprocedures (i.e., the procedure bodies) do not appear in the interface but are defined separately.The advantages are twofold:The internal structure of the type is guaranteed to be invisible to clients of the interface.There are no compilation dependencies between the definition of the concrete type and theinterface module. The definition of that type can be changed and/or recompiled at any time(perhaps subject to a size constraint; see below) without requiring recompilation of either theinterface or any client of the interface.The uses of an exported type are the same as those of any other type, e.g, to construct other types.The value provided by the interface is constant but has no accessible internal structure. In Mesa 6,there are two other important differences between exported procedures and exported types.The first is a restriction necessary to ensure type safety across module boundaries. Differentexporters of an interface can supply different implementations of any particular procedure in thatinterface. In Mesa 6, this is not true for exported types; all exporters of a particular type within aconfiguration must supply the same concrete type, which is called the standard implementation ofthat exported type. Because of this restriction, clients can safely interassign values with exportedtype T, no matter how obtained. In addition, any exporter of T may convert a value of type T to avalue of the concrete type it uses to represent T and conversely.The second difference is that it is not necessary to import an interface to access an exported typedefined within it or to distinguish among values of such a type coming from different imported fpG?LbtqXtqtFqXr L_ qtqtFqXL]rqtqL\TrqtFqLZXrqtFqXtqtq W^<r q U:* Trqrqrq* Rhrqtqr qrq r qrqrq P tqrqtqrqrqrqt qrq O t(qLLs?w swswswswsLKat swsws.wswst sws H6rt Dqtqr q# C@rqrq  A 6tqtqL?tqXtqtFqXL=vrq tqtqL;rqtFqXrq tqtqtqtq 7p 4^qr q A 2r q * 10, /hN -L+EX]L(-,L'#IL%|CL#) M 7. 7Y  Q AP r#q- : rq K14 rq8rqrq 0rq ;( 3+ > >]LMesa 6.0 Compiler Update20instances. This is another consequence of the fact that, in Mesa 6, all interfaces must reference thestandard implementation of the exported type.Interface ModulesAn exported type is declared in an interface (DEFINITIONS) module using one of the following twoforms:T: TYPE;T: TYPE [ Expression ];The first of these introduces a type T, no properties of which are known in the interface or to anyclient of the interface. In particular, the size of T is not known; this is adequate (and desirable) ifthe interface and clients deal only with values of type POINTER TO T.The second form specifies the size of the values used in the representation of the type. The valueof Expression, which must denote a compile-time constant with an unsigned integer value, givesthis size in units of machine words. Supplying the size of an exported type is a shorthand forexporting a set of fundamental operations (creation, _ , =, and #) upon that type. In Mesa 6, theeventual concrete type must supply the standard implementations of these operations, which aredefined as follows:creationallocate the specified number of words, with no initialization_copy an uninterpreted bit string=, #compare uninterpreted bit stringsNote that a type with non-NULL default value does not have the standard creation operation. Such types cannot beexported with known size. You should therefore consider writing your interfaces in terms of POINTER TO T, where Tis a completely opaque exported type and not subject to these restrictions.Client ModulesA client has no knowledge of the type T beyond those properties specified in the interface. If thesize is not specified there, no operations on T are permitted. If the size is available from theinterface, SIZE[T] is legal; also declaration of variables (including record fields and arraycomponents) and the operations _, =, # are defined for type T.Implementation ModulesAn implementor exports a type T to some interface Defs by declaring the type with the requiredidentifier, the PUBLIC attribute, and a value that is the concrete type; e.g., inT: PUBLIC TYPE = S;S specifies the concrete type. If the size of T appears in the interface, the definition of T in theexporter must specify a type with that size and with the standard fundamental operations (thecompiler checks this).Within an exporter, Defs.T and T conform freely and are assignment compatible. Otherwise, Defs.Tis treated opaquely there and is not equivalent to T (except for the purpose of checking exports).You should therefore attempt to write an exporting module entirely in terms of concrete types.Consider the following example: fpG? bqb `v- ](r Yq" t q' X2LUrqtqLTrqtqru rq Qrqrq9 O5rq NF8t qrq K8+ J#u q< H| S FS E-&rq CLA X>L>L<! 8sts3 7Dt swsw 6(sK 2r /qrq< ..rq# ,_& tqrqF' *W<RMesa 6.0 Compiler Update21Interface Module (Defs):T: TYPE;H: TYPE = POINTER TO T;R: TYPE = RECORD [f: H, ...];Proc1: PROC [h: H];Proc2: PROC [r: POINTER TO R];...Exporting Module:T: PUBLIC TYPE = RECORD [v: ...];P: TYPE = POINTER TO T;Proc1: PUBLIC PROC [h: P] = {... h.v ...};Proc2: PUBLIC PROC [r: POINTER TO Defs.R] = { q: P = r.f; ... q.v ...};...If the type of h were Defs.H in the implementation of Proc1, the reference to h.v would be illegal.By defining a type such as P and using it within the exporter instead of H, you can avoid most suchproblems. (Note that Proc1 is still exported with the proper type.) This strategy of creatingconcrete types in one-to-one correspondence to interface types involving T fails for record typessuch as R (because of the uniqueness rule for record constructors). In this example, you must useDefs.R to define the type of r in the implementation of Proc2, but a reference to r.f.v is illegal. Insuch cases, a LOOPHOLE-free implementation may require redundant assignments, such as the one toq. Alternatively, you should consider making the record type another exported type, and definingits concrete type within the exporter also.BindingFor each interface containing some exported type T, all exporters of that interface must provideequivalent concrete types for T (the binder and loader check this). In Mesa 6, the concrete typesmust in fact be identical; if two modules export T, they must obtain the same concrete definition ofT, e.g., from another shared interface module (typically, a private one).Control VariablesYou can now declare the control variable of a loop as part of the FOR clause attached to that loop.Such an identifier cannot be accessed outside the loop and cannot be updated except by the FORclause in which it is declared.SyntaxIteration::=FOR identifier Direction IN LoopRange|FOR identifier : TypeExpression Direction IN LoopRangeAssignation::=FOR identifier _ Expression , Expression|FOR identifier : TypeExpression _ Expression , ExpressionThe forms of Iteration and Assignation with ": TypeExpression" declare a new control variable.That variable cannot be explicitly updated (except by the FOR clause itself). Its scope is the entireLoopStmt introduced by the Iteration or Assignation including any LoopExitsClause. Note,however, that the value of a control variable used in an Iteration is undefined in the FinishedExit. fpG?LbqXrq_rqtq]rqtqtF qXrq\TrqtqtqrqZrqtqrqYrqtqrqtF qXrqW^LTRhrqtF qXtqrqPrqtqtF qXrqOrqtF qXrqrqrqMrrqtF qXrqtFqXrqKrqrqrqJ#rqrqH| E-rqrqrqrqrq Crq! rq Arq- @7+rq >rqP YMesa 6.0 Compiler Update22Extended NILIn Mesa 6, null values are available for all address-containing types. An address-containing type isone constructed using POINTER, DESCRIPTOR, PROCEDURE, PROGRAM, SIGNAL, ERROR, PROCESS,PORT, ZONE or a LONG or subrange form of one of the preceding. The built-in type STRING isaddress-containing. A relative pointer or relative descriptor type is not considered to be address-containing in Mesa6.Null values are denoted as follows:If T designates any address-containing type, NIL[T] denotes the corresponding null value.Whenever T is implied by context, NIL abbreviates NIL[T].If T is not implied by context, NIL means NIL[POINTER TO UNSPECIFIED] and thus continues tomatch any POINTER or LONG POINTER type.A fault will occur if you attempt to dereference a null value and have requested NIL checking; afault will occur unconditionally if you attempt to transfer control through a null value.Reject StatementWithin a catch phrase, you can use the statement REJECT to explicitly reject a signal, i.e., toterminate execution of that catch phrase and propagate the signal to the enclosing one. (Note thateach catch phrase is currently terminated by an implicit REJECT.)Process ExtensionsAborting a process now raises the predeclared signal ABORTED. The predeclared typesMONITORLOCK and CONDITION are now defined with default initialization. The only client-visiblefield is timeout in CONDITION; its default initial value is 100 ticks.Restrictions on AssignmentThe assignment operations defined upon certain types have been restricted so that variables of thosetypes can be initialized (either explicitly or by default) when they are created but cannotsubsequently be updated. A variable is considered to be created at its point of declaration or, fordynamically allocated objects, by the corresponding NEW operation.In Mesa 6, the following types have restricted assignment operations:MONITORLOCKCONDITIONany type constructed using PORTany type constructed using SEQUENCEany type constructed using ARRAY in which the component type has a restricted assignmentoperation.any type constructed using RECORD in which one of the field types has a restricted assignmentoperation.Note that the restrictions upon assignment for a type do not impose restrictions upon assignment tocomponent types. Thus selective updating of fields of a variable may be possible even when the fpG? bX ^qb ](tqt qtqtqtqtqtq [tqtqtq>tq Ys)8 XU U*qX#LRrq)tqrq'LP4rqtq tqrqLMrqtqtqtqLL tqt q H7rqtq GY BpX ?q1tq( >P <\9tq 89pX 4q;5tq< 3Ct qtq7 1rqtq) -zp *+q[ (C &d %54tq !ELkt LLuqXtLqtLqtq +L L]tq1 L ;Z ? h L=\8Mesa 6.0 Compiler Update23entire variable cannot be updated; e.g., the timeout field of a CONDITION variable can be updated byordinary assignment. Also, you may apply the operator @ to obtain the address of the entirevariable in such a situation.Operational ChangesUser InterfaceThe standard Mesa 6 Compiler reads commands only from the executive's command line; it nolonger supports interactive input. During compilation, the display and keyboard are disabled. Thecursor provides a limited amount of feedback; it moves down the screen to indicate progressthrough a sequence of commands and to the right as errors are detected. At the end ofcompilation, the message "Type Key" is displayed in a flashing cursor if there are errors and youhave requested the compiler to pause. Typing Shift-Swat aborts the Executive's currentcommand sequence; Ctrl-Swat invokes the Mesa Debugger; any other character causes normalexit from the compiler.A summary of compilation commands is written on the file Compiler.log (formerly,Mesa.typescript).Command Line ArgumentsThe Mesa 6 Compiler allows you to control the association between modules and file names at thetime you invoke the compiler. The compiler accepts a series of commands, each of which has theformoutputFile _ inputFile[id1: file1, ..., idn: filen]/switchesOnly inputFile is mandatory; it names the file containing the source text of the module to becompiled, and its default extension is .mesa. Any warning or error messages are written on thefile outputRoot.errlog, where outputRoot is the string obtained by deleting any extensionfrom outputFile, if given, otherwise from inputFile. If there are no errors or warnings, anyexisting error log with the same name is deleted at the end of the compilation.If a list of keyword arguments appears between brackets, each item establishes a correspondencebetween the name idi of an included module, as it appears in the DIRECTORY of the sourceprogram, and a file with name filei; the default extension for such file names is .bcd. (If thename of an included module is not mentioned on the command line, its file name is computedfrom information in the DIRECTORY statement; see above).The optional switches are a sequence of zero or more letters. Each letter is interpreted as aseparate switch designator, and each may optionally be preceded by - or ~ to invert the sense ofthe switch.If outputFile (and _) are omitted, the object code and symbol tables are written on the fileinputRoot.bcd, where inputRoot is inputFile with any extension deleted. Otherwise codeand symbols are written on outputFile, for which a default extension of .bcd is supplied. Ifthe compiler detects any errors, the output file is not written and any existing file with the samename is deleted.The compiler accepts a sequence of one or more commands from the executive's command line(through the file Com.cm). Commands are separated by semicolons, but you may omit a semicolon fpG? bq-rq tq `vB ^ Yxi UppX R"qF PzC NF M,M K&; I%y q H6yq" F C@:;0y q Ayqu =vpX :'qE 8B 6L4^y3t4^y3t4^y3t4^y3t4^y 12qyq8 /'yq3 -yqy q1 ,<y qyq* *O 'F S %y%t%q-tq #y#Gt#qyq " G btq  yqI lCyqyq  vy qyqH y qyqyq, ( y q#yq 30  .+ yq : =]osMesa 6.0 Compiler Update24between any two successive identifiers (file names or switches), or between a ] and an identifier (butnot between an identifier and a /). Note that any required semicolon in an Alto Executivecommand must be quoted.You can set global switches by a command with an empty file name. In the form /switches,each letter designates a different switch. Unless a command to change the global switch settingscomes first in the sequence of commands, you must separate it from the preceding command by anexplicit semicolon. Note that the form switch/c is no longer available for setting global switches.SwitchesThe following compilation options have been added:SwitchOption Controlled fimplementation of floating-point operations ltreatment of long pointers ywarning on runtime callsIf the f switch is set, the compiler generates byte code instructions for floating-point operations(these require microcode support); otherwise, it generates calls through the system dispatch vector(SD) to software routines implementing such operations. If the a and l switches are both set, thecompiler generates code using an variant of the Alto Mesa instruction set that implements longpointer accesses to a virtual memory larger than 64K (code generated using the l switch cannot beexecuted on an Alto, even if long pointers are not used). If you specify -a, the l switch is ignored.The y switch indicates that a warning message should be issued whenever the compiler generatescode to invoke a runtime procedure (including some "instructions" which are actually implementedin software).The default settings for these switches are f, -l and -y.Distribution: Mesa Users Mesa Group SD Support fpG? bqM `vyq9 ^ [Hyq Y"? X2P Vsts4 Rhp OqX2Lr rJ#qy q,IyJ#Gy q (\GQcG E-y q ByqH A @# ?d@yqyq =// <A  TIMESROMAN MATH  TIMESROMAN  HELVETICA TIMESROMAN LOGO TIMESROMAN TIMESROMAN  HELVETICA  GACHA   TIMESROMAN TIMESROMAN  TIMESROMAN  TIMESROMAN  TIMESROMAN HELVETICA HELVETICA MATH  TIMESROMAN TIMESROMAN  GACHA   %,q3;BJkQ ZabbjrZy  /5Z":#"iZ !WiW:Z": +iQB":B": +iGB":#* "B" : ;*PPB!l* "::B: ;Z":B":J"9W"iT"=#B ": C" 9B":qB)B:Z":*:B":B"i^: #: B":PP*J"PP*J":PPB"*iA":B: ;Z: j/#Compiler60.presswickM26-Oct-80 19:41:28 PST