freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

編譯原理與實(shí)踐中英雙語(yǔ)版下ppt-文庫(kù)吧在線文庫(kù)

  

【正文】 . ? The second way is creating a 4 bites table that is shown in Fig. , the first bite in Table is 1, the type is integer, the second bite is 1, it is real, the third bite 1 means logic type and fourth one represent character type. . ? The third way to store the type is shown in Fig , in this way, there are only three bites that can represent the four bites type by the second way. 25 26 27 (3)Array type in symbol table ? Different identifier need different attribute to store its information. ? for example, an identifier of array type needs to be described its dimension, scope etc., a procedure identifier should save the number of its parameters, their type if they are recursive. We often use chain table to store some special attributes and the chain table address would be as an attribute in symbol table. . 28 The Structure of Symbol Table ? . The operation of symbol table ? The operation of symbol table includes search, find, insert, deleting and update. ? As a structure definition program, there are two ways to do the operation: 29 (1) If a symbol table is unordered, the operation of insert is simple. ? Because it does not need to find a definite insert position, but it should be searched in the symbol table to be sure if there is no same symbol, the running time of search is not little. . 30 (2) If a symbol table is ordered, we should first search the insert position in symbol table, secondly to do the insert operation, so it needs double time to do the insert operation than do it in first way. . 31 ? As a no structure definition program, any symbol is considered to be the first time to insert and it must be searched by all of symbol table to make sure if it is really used firstly. Only when there is no same symbol in symbol table, the insert operation could be done. . 32 ? As a subprogram, it is allowed same identifier in different subprogram, but there is no meaning if we don’t define which subprogram the identifier belongs to. It needs two more operation except insert and search operations: create chain symbol table in subprogram entrance and deleting chain symbol table in the subprogram exit. . 33 ? (1) In the entrance of subprogram, we should build a chain symbol table to store some identifier information for: . ? for example, create chain symbol table 1 for subprogram 1, build chain symbol table 2 for subprogram 2, …… set up chain symbol table n for subprogram n, and so on. When search an identifier in subprogram n, we should search it begin from chain table n, if there is no the symbol in it, search it in chain table n1untill chain table 1 ? (2) In subprogram exit, the chain symbol table should be deleted to release the space. . 34 . The structure of symbol table ? Which kind of symbol structure you will design or choose mostly depends on storing efficiency and operation speed. There are many symbol structure tables, such as unordered symbol table, ordered symbol table, stack symbol table, tree symbol table and hash symbol table. Next we will introduce three typical symbol structures: unordered symbol table, ordered symbol table and stack symbol table. . 35 1 Unordered symbol table ? Unordered symbol table is built according to the order of identifiers appearing. unordered symbol table is suitable to little scale symbol table. Table is a kind of unordered symbol table. . 36 2 Ordered symbol table ? If identifiers are ordered by its first letter in dictionary, the symbol table is ordered symbol table. There are three steps to build ordered symbol table. . ? Step 1. Do the search operation in order to find its position in symbol table. ? Step 2. Move some identifiers’ name and attributes in symbol table. . ? Step 3. Insert identifiers at the position in symbol table. 37 3. Stack symbol table array or procedure identifiers often use chain table to store their special attributes. the chain table address would be as an attribute in symbol table. . Example can explain it . 38 Example A program with procedure. 39 ? The stack symbol table of the program is below. 40 ? During piling there are three operations in stack symbol table, they are insert, search and release. ? The operation of insert: ? When main program (level 0) is piled, identifiers and constants are pushed into stack by their appearing order. Address1 means stack start address and it is also the bottom address of this stack, address 4 represents top address of level 0. Similarly, start address of level 1 is 5, start address of level 2 is 8, and the top address of stack is 10. . 41 ? The operation of search: ? Searching an identifier is beginning from the order of stack top address, level 2, level 1 and level 0. If the identifier is not found until bottom address of this stack, the semantic check is not correct and should return error information. ? The operation of release: ? When retreat from a procedure, the identifiers of the procedure should be released and the top address of stack will change. For instance, procedure q releases from the stack, the top address of the stack is change from 10 to 7. 42 Type checking ? Semantic Checks include static and dynamic check. . ? Static means that it does checking during pilation,
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1