看板 NTUEE_VAL 關於我們 聯絡資訊
※ 引述《arjuna (機器澤新一)》之銘言: : ※ 引述《arjuna (機器澤新一)》之銘言: : : 分頭進行 : : 把group //掉就會有output,就先從這邊去檢查你寫的功能是不是正常 : : 時間不多了加油 : import的處理方法我還想到 : 就是去parse那個檔案,把parsing tree的root傳回main裡面一個 : import list,這樣有需要資料的話可以去那個paring tree找 http://www.facweb.iitkgp.ernet.in/~niloy/COURSE/Autumn2006/Compiler/main.html Assignment 1: Assignment on Thompson's Construction - understand the working of #include, #define, #ifdef, #ifndef and commenting in C preprocessor. Write a mini pre-processor for a C-language. The preprocessor should do the following: - inclusion of header files -- Implement #include preprocessor directive. The content of the argument file should be copied to the output file. - textual replacement -- Implement #define preprocessor (macro) directive that is replace the macro calls inside the program with the macro contents. Parametrized and recursive #define need not be considered. - conditional inclusion/exclusion -- Implement #ifdef and #ifndef preprocessor directives. According to the value copy the #ifdef ot #ifndef part to the output file - stripping out the comments. -- Implement both single line (//) and multiple line comments (/* */)stripping. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.216.80.156