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

正文內(nèi)容

c語言編譯器前端的設計與實現(xiàn)課程設計(參考版)

2025-06-09 22:17本頁面
  

【正文】 } } } } } return 0。 } } else { sym=ssym[ch]。 getchdo。=39。) { getchdo。 } else { if(ch==39。 getchdo。=39。) { getchdo。 } else { if(ch==39。 getchdo。=39。) { getchdo。 } } else { if(ch==39。 k。939。amp。039。 getchdo。039。 sym=number。) { k=0。ch=39。amp。 } else { if(ch=39。 if(i1j) sym=wsym[k]。 if(strcmp(id,work[k])=0) i=k+1。 do{ k=(i+j)/2。 i=0。 a[k]=0。939。amp。039。z39。amp。a39。 } getchdo。 do { if(kal) { a[k]=ch。z39。amp。a39。||ch==10||ch==9) getchdo。 while(ch==39。 return 0。 } ch = line[cc]。 } printf(\n)。 line[ll]=ch。 } printf(%c,ch)。ch)) { line[ll] = 0。39。 fprintf(fal,%d,cx)。 cc = 0。 return 1。 [7] 周峰 .Visual Basic案例開發(fā)集錦 [M].北京:電子工業(yè)出版社, 2021。 [5] 陳明 .Visual Basic教程 [M].北京:人民郵電出版社, 。 [3] 賀世娟,陳冀川 .Visual Basic 程序設計 [M].北京:中國水利水電出版社出版, 。 參考文獻 [1] 錢煥延 .編譯技術第 2版 [M].南京:東南大學出版社出版, 2021。 同時系統(tǒng)也存在的問題與改進方向 ,由于本人第一次開發(fā)編程語言編譯程序,經(jīng)驗不足,所以存在著許多不足之處。 對于系統(tǒng)的可擴展性,在設計前也做了充分的考慮,在設計時預留了一些余地,以便本系統(tǒng)在 C 語言語法不變的情況下一直都能使用,而不需要再重新開發(fā)。在開發(fā)基于 C 語言小型編譯器前端中,還是用系統(tǒng)分析、系統(tǒng)設計的思路。 函數(shù)調(diào)用參數(shù)檢測 : 檢測函數(shù) 調(diào)用時傳入?yún)?shù)的類型與函數(shù)聲明時參數(shù)的類型是否匹配。 Class CFunArgsCheck: 插入函數(shù)參數(shù)的類型,以備在下一個步驟中做匹配檢測。 主要的類, 建立符號表: Class CSymbolTable: 主要成員變量: BucketListRec* hashTable[SIZE],把 Class BucketListRec 類的對象通過hash 函數(shù)找到位置后插入。 15 BucketListRec* next。 // memory location for variable BOOL bArray。 // function scope enum TokenType type。 Class BucketListRec: 主要成員變量: CString name。 本程序在語義分析部分設計主要包括兩方面的內(nèi)容,即建立符號表和類型檢查。語義分析能夠判斷運算對象的類型是否匹配,變量是否重復聲明或沒有聲明就使用 等錯誤。詞法分析可以檢測出源程序中的非法字符,就好比自然語言中出現(xiàn)的錯字和錯詞。 編譯的各個階段都可能發(fā)現(xiàn)源程序中的錯誤。如果靜態(tài)語義正確,則進行正真的翻譯,即識別程序中各種語法成分的含義,并做相應的語義處理,生成相應的中間代碼或直接生 成目標代碼。動態(tài)語義檢查在運行時進行,需要生成相應的目標代碼;而靜態(tài)語義檢查則在編譯時完成,它主要完成以下四個方面。即確定標識符所對應數(shù)據(jù)對象的數(shù)據(jù)類型,這部分工作有時也由詞法分析來完成。具體來說,其主要任務包括以下幾部分。amp。` | `return` expression `。` continue_stmt`continue` `。` var `=` expression `)` pound_stmt goto_stmt`goto` ID `。` | expression_stmt if_stmt`if` `(` expression `)` pound_stmt | `if` `(` expression `)` pound_stmt `else` pound_stmt while_stmt`while` `(` expression `)` pound_stmt for_stmt`for` `(` var `=` expression `。amp。` | `。` `printf` `(` `` STRING `` `)` `。` 12 type_specifier`int` | `void` | `char`, actually this step is in declaration_list() fun_declarationtype_specifier ID `(` params `)` pound_stmt paramsparam_list | `void` | empty, `void` is thought as empty param_listparam_list `,` param | param paramtype_specifier ID | type_specifier ID `[` `]` pound_stmt`{` loal_declarations statement_list `}` | expression_stmt local_declarationslocal_declarations var_declaration | var_declaration `read` `(` var `)` `。 Grammar: programdeclaration_list declaration_listdeclaration_list declaration | declaration declarationvar_declaration | fun_declaration var_declarationtype_specifier ID(, ...)`。 // array size }。 // node function scope BOOL bArray。 CString szName。 } kind。 union { StmtKind stmt。 // point to sibling node int lineno。 // point to child node CTreeNode* father。其輸出形式也有多種。其基本任務是根據(jù)語言的語法規(guī)則 (即描述該語言的上下文無關文法 ),分析源程序的語法結(jié)構(gòu) (即分析如何將這些單詞組成各種語法成分,如各種表達式、語句、函數(shù)或過程等 ),并在分析過程中,對源程序進行語法正確性檢查。編譯程序在完成了詞法分析之后,就進入語法分析階段。 C 關鍵字表: auto double int struct break else long switch case enum register typedef char extern return union Const float short unsigned Continue for signed void Default goto sizeof volatile Do if static while 標識符詞法 : identifier : nondigit identifier nondigit identifier digit nondigit : one of _ a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z digit : one of 0 1 2 3 4 5 6 7 8 9 escape: \n, \r, \b, \07 11 語法分析模塊設計 在上一節(jié)中,實現(xiàn)了詞法分析程序的功能。 */, LOGICAL_OR/* || */, // others _EOF, _ID, _NUM, _STRING, _CHARACTER, _LABEL, _ERROR, _NONE }。 Class CScaner: 得到具體的的 token 類型,定義 TokenType 如下: enum TokenType { // reserved Keyword _AUTO, _DOUBLE, _INT, _STRUCT, _BREAK, _ELSE, _LONG, _SWITCH, _CASE, _ENUM, _REGISTER, _TYPEDEF
點擊復制文檔內(nèi)容
畢業(yè)設計相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1