Command symbols, external objects, and certain "system" objects are currently managed using a grammar-based dictionary scheme with the properties that:
Times for insertion and search operations are (roughly) linear in the length of the name, irrespective of the number of items in the dictionary.
Search operations can succeed on leading substring matches.
Dictionary size requirement is 8 bytes per entry plus 4f bytes per character, where the compression factor f is (substantially?) less than one, depending on the extent to which leading substrings can be commoned up.
Dictionaries are contiguous areas of (aligned) memory, accessed through 4-longword descriptors. These descriptors are records with the layout:
%recordformat f (%integer beg,pos,lim,alt), where
BEG is the address of the start of the contiguous area.
POS is the address of the first unused word within the contiguous area,
BEG<=POS<=LIM. The dictionary is full when POS=LIM.
LIM is the address of the end (=start+size) of the contguous area.
ALT is the address of a descriptor of an alternative dictionary to be searched
when an item is not found in the original dictionary. (Or Zero)
This section is still to be written
There are three primitive operations:
DEFNAME inserts a name into a dictionary
REFNAME searches a dictionary for an occurrence of a name
TRANSNAME translates a name-reference (as supplied by DEFNAME or REFNAME) back
into a name-string.
%integerfnspec(16_117c)defname(%string(255)s,%record(f)%name d,%integer size)
The name S is inserted into the dictionary described by D, additionally reserving SIZE bytes for information to be associated with S. The result is the address of a SIZE-byte area within the dictionary area.
Special cases:
RESULT=0
The dictionary is too full for S to fit.
RESULT<0
The name S is already in the dictionary. In this case, the
result is the sign-bit plus the address of the SIZE-byte area
originally associated with S.
%integerfnspec(16_1180)refname(%string(255)s,%record(f)%name d)
Dictioanry D is searched for an occurrence of name S. The result is the address of the area associated with S when it was defined.
Special cases:
RESULT=0
S is not in D.
RESULT<0
S is not in D, but T is, and S is a leading substring of T. In
this case, the result is the sign bit plus the address of the
area associated with T when it was defined. T may be identified
by performing a TRANSNAME operation (qv).
%routinespec(16_1184)transname(%integer x,%string(255)%name s)
X should be the address of some area associated with a dictionary entry. The name is extracted from the dictionary and put into string S, which should be big enough to accomodate it.
The system knows (or will know) about four built-in dictionaries. At present their descriptors live at fixed sites in the Boot Processor's local memory, though at least some of them will require to be moved into main memory at some stage.
%record(f)%spec(16_3fb0)comdict
The entries in this dictionary are the "command symbols" used by the command interpreter. The areas associated with each entry are 8 bytes long and contain two longwords. The first is a reference into the file dictionary (qv), the second contains information relevant to the command interpreter (flag symbols).
%record(f)%spec(16_3fc0)fildict
The entries in this dictionary are filenames, which the command interpreter has associated with command symbols. The associated areas are 8 bytes long. When the file has not yet been loaded, the two longwords are both zero, otherwise the first longword is the address of the start of the file, the second longword is the address of the end (start+size) of the file.
%record(f)%spec(16_3fd0)extdict <Not actually used yet>
This dictionary is (will be?) used by compiled programs to establish linkage of external objects (procedures, variables, ...?). The associated area is 8 (? cross-ref with DEFEXT) bytes long. The first longword is the address of the object, the second is the address of type information relevant to that object.
%record(f)%spec(16_3fe0)sysdict <Not actually used yet>
This dictionary will contain entries relevant to the multi-process system, such as process names, semaphore names, server queue names and the like, if and when it is desirable for these to be described other than through the external linkage mechanism.
Parameters:
-System : Display system dictionary
-Command : Display command symbol dictionary
-External: Display External dictionary
-File : Display File dictionary
-Memory : Display memory bounds
Options are inclusive.
-Output : File to which output is to be sent (Default console)
Parameters are handled by PAM
Parameter: Symbol to be translated
Additional parameters:
-s: Look symbol up in system dictionary
-c: Look symbol up in command symbol dictionary (default)
-e: Look symbol up in external dictionary
-f: Look symbol up in file dictionary
Options are exclusive.
IMP include files containing specifications of the routines described here may be found in..
I:DICT.INC (Current operating system) INC:DICT.IMP (New operating system)
view:dict printed on 16/02/89 at 15.31