合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

        COMP3173 23F 代寫、代做 C++設計程序

        時間:2024-01-03  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



        Project Implementation
        Phase 3 Semantic Analysis
        This phase is optional. The groups who implement this phase will receive at most 20% bonus of this project. But, the total mark will be capped at 100%.
         
        In phase 1 & 2, you have already implemented a lexerand a parser to check lexical errors and syntax errors. In the next phase, you will do the semantic analysis on the source program. Semantic analysis can be type checking and expression evaluation. 
        Type system
        To check types of the source program you need 
        - Define a type system for the grammar.
        - Implement the type system as a program.
        Here are some tips for the type system.
        - This language has three types.
        - “nat”, natural number
        o declared by variable declaration “nat”, or 
        o obtained by arithmetic expressions, like “1 + 2”.
        - “bool”, Booleans 
        o declared by variable declaration “bool”, 
        o obtained by Boolean expressions, like “T & T”, or
        o obtained by relational comparison, like “2 < 1”.
        - “fun”, functions
        o declared by function declaration “fun”.
        o Note that not all functions are of the same type. For example, some possible functions can be “fun: natnat” and “fun: natboolnat”.
        - A part of the type system is already discussed in Assignment 3. You can use the solutions directly.
        - Typing functions can be very tricky for recursive functions. Function declarations are produced by the grammar rule (Rule 3)
        F -> fun id A -> C
        A naïve type rule can be 
        addtype(id.entry, A.type -> C.type)
        This type rule works fine for non-recursive functions but fails on recursions. In recursion functions, “C” is an expression about “id”. So, “id.type” depends on “C.type”, which depends on “id.type” itself! For the students who are interested, check Hindley-Milner algorithm for a solution.
         
        Evaluation
        Recall that a piece of source code in our language consists of zero, or one, or multiple function declarations, and followed by a single arithmetic expression. Thus, we can implement an interpreter for this language. The interpreter simply evaluates the arithmetic expression in the source code. To implement an interpreter, you need to define a set of syntax-directed definitions (similar to the type system), which calculate the values of the arithmetic expression.
        Evaluations can sometimes be not easy when the expression contains function calls. To systematicallyevaluate function calls, you can search -reduction for asolution.
         
        Implementation
        When you implement the type checker or the interpreter, you need to slightly modify the code from Phase 1 & 2 to make it fit. For example, the type checker needs an extra piece of storage for every node in the parse tree to hold the type for the expression. Thus, there is no restrictions on the modifications. You have your own choice.
         
        Mark Distribution
        - 5% for type checking without recursion functions
        - 5% for type checking recursion functions
        - 5% for evaluation without function calls
        - 5% for evaluation with function calls
         
        Submission requirements
        Each team need to clearly indicate the contribution of each team member in a txt file. To submit your work, you need to pack all files (source code and contribution txt) in a package. Rename the package as COMP31**_23F_SectionXX_TeamYY, where XX is your section number and YY is your team number. Only team leaders need to upload the package to iSpace.
        請加QQ:99515681 或郵箱:99515681@qq.com   WX:codehelp

        掃一掃在手機打開當前頁
      1. 上一篇:CS109 代做、代寫 java 設計編程
      2. 下一篇:代寫 Scene Recognition
      3. 無相關信息
        合肥生活資訊

        合肥圖文信息
        出評 開團工具
        出評 開團工具
        挖掘機濾芯提升發動機性能
        挖掘機濾芯提升發動機性能
        戴納斯帝壁掛爐全國售后服務電話24小時官網400(全國服務熱線)
        戴納斯帝壁掛爐全國售后服務電話24小時官網
        菲斯曼壁掛爐全國統一400售后維修服務電話24小時服務熱線
        菲斯曼壁掛爐全國統一400售后維修服務電話2
        美的熱水器售后服務技術咨詢電話全國24小時客服熱線
        美的熱水器售后服務技術咨詢電話全國24小時
        海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
        海信羅馬假日洗衣機亮相AWE 復古美學與現代
        合肥機場巴士4號線
        合肥機場巴士4號線
        合肥機場巴士3號線
        合肥機場巴士3號線
      4. 上海廠房出租 短信驗證碼 酒店vi設計

        主站蜘蛛池模板: 51视频国产精品一区二区| 无码国产精品一区二区免费16| 国产91久久精品一区二区| 无码av免费毛片一区二区| 波多野结衣一区二区三区88| 日韩制服国产精品一区| 蜜芽亚洲av无码一区二区三区 | 在线精品日韩一区二区三区| 亚洲一区二区三区电影| 韩国一区二区三区| 亚洲一区二区三区在线网站| 中文字幕亚洲乱码熟女一区二区 | 国产精品资源一区二区| 久久久久久免费一区二区三区| 欧洲精品码一区二区三区| 在线观看国产一区二三区| 国产成人无码一区二区三区在线 | 国产内射999视频一区| 国产精品一区二区av不卡| 一区二区三区在线| 一区五十路在线中出| 中文字幕一区二区区免| 国产裸体歌舞一区二区| 亚洲一区动漫卡通在线播放| 精品人妻系列无码一区二区三区 | 人妻久久久一区二区三区 | 久久国产香蕉一区精品 | 暖暖免费高清日本一区二区三区| 亚洲欧美日韩一区二区三区在线| 亚洲国产福利精品一区二区| 无码一区二区三区AV免费| 国产一区二区三区樱花动漫| 国产AV午夜精品一区二区三区| 国产精品揄拍一区二区久久| 一区二区三区在线观看中文字幕| 中文人妻av高清一区二区| 成人精品一区二区不卡视频| 国产高清在线精品一区二区 | 国产乱码精品一区二区三区| 国产免费伦精品一区二区三区| 91精品乱码一区二区三区|