Partial support for integer divisions in access vectors
[suif.git] / html / suif1_102.html
blob706a40d4a0b717d5a2c132a096b4889c6b35e1d7
1 <HTML>
2 <HEAD>
3 <!-- This HTML file has been created by texi2html 1.54
4 from suif1.texi on 28 April 1999 -->
6 <TITLE>The SUIF Version 1 Library - Lexicon</TITLE>
7 <link href="suif1_103.html" rel=Next>
8 <link href="suif1_101.html" rel=Previous>
9 <link href="suif1_toc.html" rel=ToC>
11 </HEAD>
12 <BODY>
13 <p>Go to the <A HREF="suif1_1.html">first</A>, <A HREF="suif1_101.html">previous</A>, <A HREF="suif1_103.html">next</A>, <A HREF="suif1_113.html">last</A> section, <A HREF="suif1_toc.html">table of contents</A>.
14 <P><HR><P>
17 <H2><A NAME="SEC102" HREF="suif1_toc.html#TOC102">Lexicon</A></H2>
18 <P>
19 <A NAME="IDX723"></A>
20 <A NAME="IDX724"></A>
22 </P>
23 <P>
24 <A NAME="IDX725"></A>
25 <A NAME="IDX726"></A>
26 Almost all character strings in SUIF are entered in a hash table called
27 the <CODE>lexicon</CODE>. This table removes duplicate strings so that string
28 comparisons can be reduced to simple pointer comparisons. The
29 <CODE>lexicon</CODE> is an object of the <CODE>string_table</CODE> class defined in
30 the <TT>`stringtable.h'</TT> and <TT>`stringtable.cc'</TT> files.
32 </P>
33 <P>
34 <A NAME="IDX727"></A>
35 <A NAME="IDX728"></A>
36 A <CODE>string_table</CODE> is an open hash table; each bucket is a linked
37 list of string entries represented by objects of the <CODE>string_e</CODE>
38 class. The only public method in the <CODE>string_table</CODE> class is
39 called <CODE>enter</CODE>. This method searches the table for a specified
40 string. If the string is found, <CODE>enter</CODE> returns a pointer to the
41 existing <CODE>string_e</CODE> entry. Otherwise, it creates a new entry and
42 adds it to the table. In either case, the actual character string
43 pointer can be retrieved directly from the <CODE>sp</CODE> field of the
44 resulting <CODE>string_e</CODE> entry.
46 </P>
47 <P>
48 None of the strings in the <CODE>lexicon</CODE> are deallocated until a SUIF
49 program terminates. Consequently, when adding a new string to the
50 table, it is copied to the heap in case the original string is stored on
51 the stack. If the string is known to be allocated on the heap and will
52 never be modified or deallocated, this string copy can be avoided by
53 setting the optional <CODE>fixed</CODE> flag when calling <CODE>enter</CODE>.
55 </P>
57 <P><HR><P>
58 <p>Go to the <A HREF="suif1_1.html">first</A>, <A HREF="suif1_101.html">previous</A>, <A HREF="suif1_103.html">next</A>, <A HREF="suif1_113.html">last</A> section, <A HREF="suif1_toc.html">table of contents</A>.
59 </BODY>
60 </HTML>