Partial support for integer divisions in access vectors
[suif.git] / html / suif1_48.html
blob68cfd4b8ac3b9e737df36b4f3a4ccf6f71a54901
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 - Creating New Entries</TITLE>
7 <link href="suif1_49.html" rel=Next>
8 <link href="suif1_47.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_47.html">previous</A>, <A HREF="suif1_49.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="SEC48" HREF="suif1_toc.html#TOC48">Creating New Entries</A></H2>
19 <P>
20 To make it easier to add new entries, the symbol tables provide methods
21 that combine the steps of creating new objects and then entering them in
22 the tables. Some of these methods automatically make sure that the new
23 entries have unique names and that is particularly useful.
25 </P>
26 <P>
27 <A NAME="IDX302"></A>
28 <A NAME="IDX303"></A>
29 New variables can be added to tables anywhere in the symbol table
30 hierarchy. The <CODE>new_var</CODE> method creates a new variable with a
31 given name and type and then enters the new variable symbol in the
32 table. The <CODE>new_unique_var</CODE> method is similar, but it also checks
33 that the name of the new variable is unique. If not, it appends a
34 number to the specified name until it is unique. With this method, the
35 base name is optional; the default value is <SAMP>`suif_tmp'</SAMP>.
37 </P>
38 <P>
39 <A NAME="IDX304"></A>
40 Procedure symbols can be created in global and file symbol tables using
41 the <CODE>new_proc</CODE> method. The name of the procedure, its type, and
42 the source language must be specified. There is currently no method to
43 automatically create a new procedure symbol with a unique name.
45 </P>
46 <P>
47 <A NAME="IDX305"></A>
48 <A NAME="IDX306"></A>
49 Because label symbols may only be declared within procedures, the
50 <CODE>new_label</CODE> and <CODE>new_unique_label</CODE> methods are provided in the
51 <CODE>block_symtab</CODE> class. The only parameter of these methods is the
52 name of the label. The name is optional for <CODE>new_unique_label</CODE>;
53 its default value is <SAMP>`L'</SAMP>. Just as with variables, unique label
54 names are created by adding a number to the end of the base names.
56 </P>
57 <P>
58 <A NAME="IDX307"></A>
59 Within a procedure, new inner scopes may be created to be used with new
60 <CODE>tree_block</CODE> nodes. The <CODE>block_symtab</CODE> class provides the
61 <CODE>new_unique_child</CODE> method to create a new symbol table, give it a
62 unique name, and add it to the list of children. The unique name is
63 created by appending a number to the optional base name. If the base
64 name is not given, it defaults to <SAMP>`block'</SAMP>. This method is not
65 needed at the global level, because the child symbol tables there
66 correspond to procedures which should already have unique names.
68 </P>
69 <P>
70 <A NAME="IDX308"></A>
71 Finally, new variable definitions can be added to any symbol table using
72 the <CODE>define_var</CODE> method. The parameters are the variable symbol
73 and the alignment for the storage to be defined. It returns a pointer
74 to the new variable definition object, so that you can attach initial
75 data annotations to it.
77 </P>
79 <P><HR><P>
80 <p>Go to the <A HREF="suif1_1.html">first</A>, <A HREF="suif1_47.html">previous</A>, <A HREF="suif1_49.html">next</A>, <A HREF="suif1_113.html">last</A> section, <A HREF="suif1_toc.html">table of contents</A>.
81 </BODY>
82 </HTML>