انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة
الكلية كلية العلوم للبنات
القسم قسم الحاسبات
المرحلة 3
أستاذ المادة اسراء هادي عبيد السلطاني
04/06/2018 08:34:18
Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure. Symbol Table Management A symbol table is a data structure used by a compiler to keep track of scope binding information about names. This information is used in the source program to identify the various program elements, like variables, constants, procedures, and the labels of statements. The symbol table is searched every time a name is encountered in the source text. When a new name or new information about an existing name is discovered, the content of the symbol table changes. Therefore, a symbol table must have an efficient mechanism for accessing the information held in the table as well as for adding new entries to the symbol table
What information is stored in the symbol table?
What items to enter in the symbol table? • Variable names; defined constants; procedure and function names; literal constants and strings; source text labels; compiler-generated temporaries.
What kind of information might the compiler need about each item: • textual name, data type, declaring procedure, storage information. Depending on the type of the object, the compiler may want to know list of fields (for structures), number of parameters and types (for functions), etc…
In practice, many different tables may exist. Symbol table information is accessed frequently: hence, efficiency of access is critical!
IMPLEMENTATION Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name, the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in the following Figure.
المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .
|