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

正文內(nèi)容

編譯原理與實踐中英雙語版上ppt(編輯修改稿)

2025-03-20 09:48 本頁面
 

【文章內(nèi)容簡介】 n ? This section further discusses some piler concepts. It is not necessary for all the pilers to consist of all six phase, some pilers only have three phases. In this book, we mainly introduce the mon piler structure (six phases) shown in . Every phase of a piler will be discussed in detail in the following chapters. . 26 ? Compilers are not particularly difficult programs to understand once you are familiar with the structure of a piler in a general way. The point is that not any of the phases of a piler is hard to understand。 but, there are so many phases that you need to absorb and make sense of them. Table is the description of each of the piler phases. ? Table Description of piler phases 表 編譯器組成階段的說明 27 28 The pass of piler ? Compiler is a plex program. When a source program is piled, it often needs several passes to finish all phases of piler. So we name the distinct chunk pass. It is a part of t h e c o m p i l a t i o n p r o c e s s and it municates with one another via temporary file. The typical structure is a fourpass piler, it is shown in . . 29 ? The first pass is preprocessor. Its first task is to strip ments from the source code, such as {,} or begin, end. Second task is to handle various housekeeping tasks with which you don‘t want to burden the piler proper, for example, the housekeeping is include in the source program language C. The second pass is the heart of piler, it consist of lexical analysis, parser, semantic analyzer, and intermediate code generator. . 30 ? The input is source language, and output is intermediate language. The third pass is the optimizer, which improves the quality of the intermediate code. Finally, the fourth pass, it translates the optimizer code into real assembly language or some other form of binary, executable code. . 31 ? Note: There are many different passes of a piler. Not all pilers have four passes. Some have two passes, others generate assembly language in the third pass, and some piler only has one pass. Many pilers do not use preprocessors, or have intermediate language, but generate the machine code directly . . 32 Compiler example1 ? So far we have described all the piler phases and some theory knowledge about it. But, what is a piler program? How to build a piler from a simple expression? We give some parts of a typical piler program and explain the piler phase that consists of lexical analysis (Lex), parser analyzer (Yacc) and code generation (ANSI C code generator). ? Lex and Yacc can generate program fragments that solve the task of reading the source program and discovering its structure. . 33 ? Lex is well suited for segmenting input in preparation for a parsing routine and helps write programs whose control flow is directed by instances of regular expressions in the input stream. Lex table made up of regular expressions and corresponding program fragments is translated to a program that reads an input stream, copy it to an output stream and partition the input into strings that match the given expressions. What‘s more, Lex can generate the recognition of the expressions and strings to corresponding program fragments that are executed. 34 ? The Yacc specifies the structures of his input and recognize each structure. Yacc changes such a specification into a subroutine that handles the input process。 usually, it uses the subroutine to make it convenient and appropriate to handle the flow of control. . ? Note: The following piler code is provided by Jeremy Bent and he has permitted to add his code to this book. We sincerely thank him for his kind support. If you wish to read the plete piler source code, please access the Jeremy Bent‘s website at . . 35 The lexical analysis ? Let us first discuss the concept of token. Token is an input symbol, which is used both for digitals and identifiers。 so the tokens are made up of a sequence of characters in the range ?09‘, ?az‘, ?AZ‘. The following lexical program is only a part of the whole lexical analysis. It starts from input system, getting characters from standard input, and then isolating tokens. The detailed lexical analysis is as follows. . 36 ? It starts from the definition of syntax analyzer, which is to obtain the definition of type and of the routine parse program . . ? (LEX scanner for the vc piler) 37 38 39 40 41 42 43 The Parser ? In the parser phase no code is generated, it just analyze the input tokens, . parse the input. Each subroutine corresponds to the left of one sentence and in the original grammar that bears the same name, and it must match the grammar exactly. The following parser part includes the routine to make an IF statement, a WHILE loop and expression node. ? ( YACC parser for the vc piler) 44 45 46 47 Code generation ? Moving on to the code generation, the goal of this phase is to build a piler given that the programs in the phase of parser have been strictly recognized without any error, here the error means that the input is an illegal sentence in the grammar. However, before generating code, first you need to build the barbones recognizer. . ? For example: a := b op c 48 ? We need create some temporary variables and maintain internally by the p
點擊復制文檔內(nèi)容
教學課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1