天美麻花星空免费观看乡村版,免费直接进入黄色网站,神马老子午夜电影,亚洲美女视频一区二区三区

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

COMP3173 23F 代寫、代做 C++設(shè)計(jì)程序

時(shí)間:2024-01-03  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



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.
請(qǐng)加QQ:99515681 或郵箱:99515681@qq.com   WX:codehelp

掃一掃在手機(jī)打開當(dāng)前頁
  • 上一篇:CS109 代做、代寫 java 設(shè)計(jì)編程
  • 下一篇:代寫 Scene Recognition
  • 無相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計(jì)優(yōu)化
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計(jì)優(yōu)化
    出評(píng) 開團(tuán)工具
    出評(píng) 開團(tuán)工具
    挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
    挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
    海信羅馬假日洗衣機(jī)亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
    海信羅馬假日洗衣機(jī)亮相AWE 復(fù)古美學(xué)與現(xiàn)代
    合肥機(jī)場(chǎng)巴士4號(hào)線
    合肥機(jī)場(chǎng)巴士4號(hào)線
    合肥機(jī)場(chǎng)巴士3號(hào)線
    合肥機(jī)場(chǎng)巴士3號(hào)線
    合肥機(jī)場(chǎng)巴士2號(hào)線
    合肥機(jī)場(chǎng)巴士2號(hào)線
    合肥機(jī)場(chǎng)巴士1號(hào)線
    合肥機(jī)場(chǎng)巴士1號(hào)線
  • 短信驗(yàn)證碼 酒店vi設(shè)計(jì) deepseek 幣安下載 AI生圖 AI寫作 aippt AI生成PPT 阿里商辦

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045