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

正文內(nèi)容

編譯原理與實(shí)踐中英雙語(yǔ)版下ppt(編輯修改稿)

2025-03-20 14:08 本頁(yè)面
 

【文章內(nèi)容簡(jiǎn)介】 ? 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, , ? Dynamic check is done during runtime. 43 ? Type checking is one of these static checking operations. Some systems also use dynamic type checking. . ? A programming language is stronglytyped, if every program its piler accepts will execute without type. . ? errors. In practice, some of type checking operations are done at runtime, so most of the programming languages are not stronglytyped. 44 ? For example: int x[100]。 … x[i] most of the pilers cannot guarantee that i will be between 0 and 99. . 45 1 Type expression A type expression can be: ? A basic type: a primitive data type such as integer, real, char, boolean, … ? Structured Types: ? arrays: if T is a type expression, then array(I,T) is a type expression where I denotes index range. For example: array(0..10,int) . ? products: if T1 and T2 are type expressions, then their cartesian product T1 x T2 is a type expression. For example: int x int . 46 ? pointers: If T is a type expression, then pointer(T) is a type expression. For example: pointer(int). . ? functions: We may treat functions in a programming language as mapping from a domain type D to a range type R. So, the type of a function can be denoted by the type expression D→R where D are R type expressions. For example: int→int represents the type of a function that takes an int value as parameter, and its return type is also int. . 47 2 Type Checking ? Type checking consists of Expressions type checking, statements type checking, functions type checking and structural expressions type checking. They are introduced by the next tables and their algorithms are in the right of the table. 48 Chapter 7 Storage Organization and Register Allocation Zhang Jing, Wang HaiLing College of Computer Science amp。 Technology Harbin Engineering University 50 ? There are two strategies that are often used: static allocation and dynamic allocation. Static allocation refer to that variables and constants are bound to stored when program is piled, in addition, the storage of variables and constants would not be changed at run time. . 51 ? The storage of FORTRAN is static allocation. Dynamic allocation means that allocation is done at run time, namely, data structures can be created dynamically and sometime it is a kind of symbol table or subprogram. PASCAL program storage is a kind of dynamic allocation. . 52 ? static allocation and dynamic allocation are often used . ? Static allocation refer to that variables and constants are bound to stored when program is piled, in addition, the storage of variables and constants would not be changed at run time. The storage of FORTRAN is static allocation. . ? Dynamic allocation means that allocation is done at run time, namely, data structures can be created dynamically and sometime it is a kind of symbol table or subprogram. PASCAL program storage is a kind of dynamic allocation. . 53 Static Storage Allocation ? ( 1) The size of a data objects and constraints on its position in memory must be known before piling. . ? ( 2) Recursive procedures are restricted, because all activations of procedure use the same bindings for local names. . 54 ? Compiler determines the amount of storage to set aside by t
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1