Download Thesis - Department of Programming Languages and Compilers
Transcript
3. Development Manual 81 Implementation The function gets the name of the module from the form_ list, node_type, attribute and name tables with a select SQL query. The module identifiers have to be the same in all table and with the converted second parameter. The identifier in the node_type table have to be the same as the form in the form_list table. The type in the node_type table has to be 4 (attribute). The identifier in the attribute_ table has to be the same as the form. The identifier in the name table has to be the same as the argument. The position in the attribute_ table has to be 1. The identifier in the attribute_ table has to be between the following identifiers: the argument in the attribute_table has to be the same as the identifier in the name table and the name has to be "module". The function returns with the module name. get_module_name_if_exists_in_module/4 Description The function gets the name of the module, if the current function (identified by the last two parameter) is exists in the module. If the function is exists in the module the return value is the name of the module, else false. The parameters: 1. Ref : The reference id of the ODBC connection. 2. MId : The identifier of the module. 3. Name : The name of the function. 4. Arity : The arity of the function. The function is used in the into_db:get_module_name/4 function. Example: case refactor:get_module_name_if_exists_in_module( Ref, MId, Name, Arity) of Implementation • At first the function gets the module identifier where the current function exists from the function, fun_visib, name tables with a select SQL query. The module identifiers have to be the same in all tables and with the converted second parameter. The argument in the fun_visib table has to be the same as the converted arity (fourth parameter) and the position has to be 0 in the fun_visib table. The identifiers have to be the same in the fun_visib and function tables. The clause in the function table has to be the same as the identifier in the name table and the position has to be 0 in the function table. The name in the name table has to be the same as the third parameter. • After it the function checks in a case structure if the module identifier list is empty: 1. When the list is empty, it means that the current function is not exists in the module: the return value is false.