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

正文內(nèi)容

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

  

【正文】 ? Attribute of address ? Attribute of level in program ? Attribute of line position in source program 10 ? Attribute of kind Kind can describe the characteristics of a symbol. Every symbol has its own type, such as constant, variable and procedure. . ? Attribute of dimension or size If an identifier is a name of an array, then we should store the dimension and boundary of identifier value as an attribute of it. . 11 ? Attribute of parameter If an identifier is a name of a procedure, the parameters of the procedure should be recorded as an attribute. . ? Attribute of address In source program, an identifier or a constant are often related with a unit address to acplish some operation. So the addresses of them are put in symbol table as an attribute. . 12 ? Attribute of level in program Symbol in program or subprogram, the level of its position in program should be written as an attribute in symbol table. In some source languages, identifiers can have same name in different level of program, so attribute of level in program could help recognize them. . ? Attribute of line position in source program Sometimes the line position of symbol in source program is needed to be stored as an attribute in symbol table in order to obtain the correct semantic checking. . 13 ? Attribute of constant value If the symbol is a constant, then the value of it should been stored as a value attribute in symbol table. . Attributes above are not all the attributes a symbol table has, some symbols used for special may has particular attributes. To sum up, the function of symbol table is for checking up if the semantic in source program is correct. 14 Example ? The definition of constants is: Const pi= r=10 Its symbol table is: Name pi r Kind real int Value 10 15 Example ? The definition of variables is: Var i, j: integer。 then B(I)=P,C(I)=1,(If space P is not allocated, P means the space of the storage of block I). Judge if the matrix of C(I)=0 (I =1, … ,n), , ? then go to step 2,otherwise go to end 70 Step 3: ? If A(K,J)=1(J=I,K=1, … ,n) and B(K)≤P, then B(K)=P+1,(because the units before unit P have been allocated, If B(K)≤P represents that the unit P has been reused. So the allocation of B(K) should begin from the unit of P+1). If B ( K ) P , t h e n B ( K ) w o u l d n o t be changed. . 71 Step 4: ? Turn matrix A(K,J)=1 into A(K,J)=0 Step 5: ? Judge if the matrix of C(I)=0 (I =1, … ,n), then go to step 2,otherwise go to end 72 Table . The relation matrix of example 表 例 模塊間關(guān)系矩陣 ? 73 ? The first time of running static level storage algorithm: : ? Step 1, B(I) =0, C(I) =0 the value of A(I,J) is shown in Table . ? S t e p 2, b e c a u s e A(4,J ) = 0 ( J= 1, … , 5), A(5,J)=0(J=1, … ,5), in addition C(4)=0, C(5)=0. The value of P in block 4 is 9, P in block 5 is 8。 VAR d: real。 …… 84 END 。 …… END.{ main} two parallel procedures that are procedure 2 and procedure 3. Procedure 2 calls procedure 4 and procedure 5, procedure 3 runs procedure 4 and procedure 5 too 86 ? In the main program, there are one constant a and two identifiers b and c that need to be pushed into stack S1, then we first run procedure 2 and at the same time to allocate stack S2 that includes identifiers x and d, next allocate identifiers y and e to S3 for procedure 4, furthermore, it is the turn of procedure 5 that are allocated by stack S4, its identifiers are z and i. Because procedure 3 also calls procedure 4 and procedure 5, the allocation of procedure 3 is stack S5, the identifiers in stack S6 and S7 are same with stack S3 and S4. All of the stack allocation is shown in figure . 87 ? When procedure returns to main program, stacks are firstly released from the top of the stack, that is stack S7, then stack S6 is released, next is the turn of S5 and so on , the program can not be finished until stack S1 is released. ? a, b, c S1 (a) x, d S2 S1 (b) a, b, c (c) y, e S3 S2 S1 a, b, c x, d 88 ? (d) z, i S1 S2 S3 S4 x, d a, b, c y, e z, i S1 S2 S3 S4 x, d a, b, c y, e h, f S5 (e) z, i y, e z, i S1 S2 S3 S4 x, d a, b, c y, e h, f S5 (f) Fig. Runtime stack 圖 示例的運(yùn)行棧 S 89 ? Allocation with nested procedure 90 ? From example , we know that there are nested procedures in it. Such as procedure 4 and procedure 5 are nested in procedure 2, so is procedure 3. But, how to connect the nested calling procedure with called procedure? We add a pointer named access link to each activation record. If procedure 4 is nested within the most recent activation procedure 2, the access link in activation record for procedure 4 points to the access link in the record for procedure 2, it is shown in figure . . 91 ? In figure b, we can see that there is procedure 4 in the stack. If we want to find the calling of procedure 4 quickly, it is better to know the depth of procedure 4, namely, when we should label the nesting depth of every procedure. Let the main program be at nesting dep
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1