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

正文內(nèi)容

編譯原理與實(shí)踐中英雙語(yǔ)版下ppt(完整版)

  

【正文】 , ? 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]。 storage is anized as a stack, activation records are pushed into stack when activations begin, and they are popped after activations ending. . 80 ? Identifier, constant and variable are named records, name it local. Locals are bound to fresh each activation storage, When the activation ends, the storage for locals disappears when the activation record is popped . 81 ? We use register pointer to mark the top of the stack. At running time, an activation record can be allocated by incrementing by the size of the record, and deallocated by decrementing top according to the size of the record. For example, Procedure P has an activation record of size a, then the top is incremented by a, as P is released, top is d e c r e m e n t e d by a . 82 Example ? PROGRAM main (input, output)。 …… END 。 BEGIN …… 4 (f)。 …… END。 BEGIN …… z=z+a …… END 。 VAR b: integer。 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 the type of data. A data type, such as a character, integer or real, can usually be stored in some bytes, . ? for example, integer is 2 bites, real is 4 bites. Storage for a bined type . 55 ? The length of data above is definite and their data are saved as fields in symbol table. ? Variablelength data is kept in other place outside this field。 Technology Harbin Engineering University 3 ? some symbols must be collected and be put together into tables— Symbol Table. There are two functions in symbol table, the first one is to help check if the semantic is correct, the second one is to assist generating the code. To sum up, this chapter would introduce the functions, content, structure and operation of symbol table. 4 The Functions of Symbol Tables ? The functions of symbol table are: ( 1) Store information ( 2) Types Checking ( 3) Data Address 5 ? Store information: Before store information, we firstly should divided the data into different types, then put them into the corresponded tables. Sometimes information is stored in table during lexical analysis, sometimes it is done in semantic analysis. . If the data is an identifier, it would be stored in an identifier table, else if the data is a constant, it will be put into a constant table. 6 ? Types Checking ? A piler uses a symbol table to keep track of the type and binding information about names. The symbol table is searched every time by a name that is encountered in the source text. If a new name or new information about an existing name is discovered, the table is changed. 7 ? Data Address: ? When a data was stored, the data’s address in the table was also recorded as an attribute of the table. In the period of code generation in piler, the data address can be obtained from the symbol table and can be used directly. . 8 The Attribute of Symbol Table ? Symbol table is created according to symbol’s name, so the keyword of the symbol table is symbol’s name. Except name attribute, there are also six attributes of a symbol in symbol table using for semantic checking. . 9 The six attributes of a symbol as follow: ? Attribute of kind ? Attribute of dimension or size ? Attribute of parameter
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1