Semantic Analysisenterid, searchid, searchsection, getbounds,equalbounds, comptypesno endless recursion for cyclic date structures (pointers)1 1Code Generationgen0, gent, gen2, genOt, genit, gen2tgenerate code for 0, 1 or 2 parameters with or without typesmes: computes maximum step depthgenfjp, genujpxjp, gencupent: branch switch and procedure callalignquot, align: address computationsload, store, loadaddress: operand loads and storescheckbnds: checks boundsgenlabel, putlabel: generation of labels12
JVIII ■ 111t14 /1.11111ySIS ai Y P 9 3TYPESTypes are represented internally by the type structure [118-321,All types use the size field, which contains the run-time store size needed tohold an object of that type. (<strong>The</strong> marked field Is used only/ by the procedurepri► ttables (676 -845j when printing out the compiler tables, If the t option Isswitched on.)All other fields depend on the form of the typo, If It is a pointer, or an array,and so on.ScalarA scalar type is either declared, that is, an enumeration, in which case fconstpoints to the last identifier in the list (they are linked together by their nextfield) 11061) ; or it is standard, when the typo is Integer, real,,or char (booleanis declared). <strong>The</strong>se latter four can be distinguished by comparing the pointervalue to the structure with one of the four pointers Intptr, realptr, charptr,boolptr, which are initialised [3646 et seql (sec for example [652-7]).SubrangeHere rangctype points to the type of which this is a subrange (for example,integer in / .. 10); and Min and max hold the minimum and maylmum values(1 and 10 in the above case).PointerEl type points to the type pointed at (Integer IntInteger).PowerFor sets, visa points to the clement type of the set (for example, char in set ofchar),Arraysht.v type points to the index type of the array and aeltype to the clement type,(e.g. char and integer respectively In array/ char/ of Integer).A niulti•dimensional array, like array /1. .10, 1. ./Of of real is treatedidentically to array //. ./Of of array //, ,101 of real so here would give1.1111,4FilesFiltype points to the file type (for Ixample Integer in file of Integer).RecordsFstfld points to the first field of the record, the other fields being linked to the1 binary tree described before.Recvar points to a structure of form hied representing the variant part ofthe record (It is nil if there Is no variant part).A tried hAs' two fields: tagfldp points to the Identifier for the tag field, andhivar points to a list of structures of form variant, each representing one of theease labels.As an example:type rx record I: Integer;case b: colour ofred, blue: (J: Integer);green: (k: integer;case c: boolean oftrue: (a: real)end;11=111111111=antiI • I_I 1