这里写自定义目录标题

  • 1.PSP
  • 2.Description of problem-solving ideas
  • 3.Design and implementation process.
  • 4.Code description.
    • 1.The first level
    • 2.The second level
    • 3.The third level
    • 4.The fourth level
    • 5.display
  • 5.Unit test screenshots and description
  • 6.Summary
The Link Your Class https://bbs.csdn.net/forums/MUEE308FZU202201
The Link of Requirement of This Assignment https://bbs.csdn.net/topics/608734907
The Aim of This Assignment learn how to use git and submit codes , learn how to use unit test and performance test and extract keywords of different levels from the C or C++ code files that are read in.
MU STU ID and FZU STU ID 20123434/832001102

My github is here:https://github.com/yycgod123/EE308-Lab1-2

1.PSP

Personal Software Process Stages Estimated Time/minutes Completed Time/minutes
Planning 10 10
Estimate 20 20
Developmemt None None
Analysis 160 300
Design Spec 50 50
Design Review 20 30
Coding Standard 10 10
Design 200 300
Coding 600 800
Code ReviewPlanning 40 45
Test 100 150
Reporting 80 100
Test Report - -
Size Measurement 10 10
Postmortem&Process Improvement 120 200
total 1420 2025

2.Description of problem-solving ideas

In this lab, I decided to test the code in Python language. The first thing I’m going to do is use Python to filter out the symbols that I don’t want in the code I’m testing.[“+”, “-”, “*”, “/”, “<”, “<=”, “>”, “>=”, “=”, “==”, “!=”, “;”, “(”, “)”, “^”, “,”, “”“, “'”, “#”, “&”,&&”, “|”, “||”, “%”, “~”, “<<”, “>>”, “[”, “]”, “{”, “}”, “\”, “.”, “:”, “!”] ,so I will remove them before my testing.The next thing I need to do is write the code I’m going to test to a file and let Python read it, which makes it easier for me.After Python read the file, I removed all the symbols I didn’t need and used Python’s split function to change the article into English words, which was more convenient for my later code writing.For the first question, it is easy to collect all the keywords in C++, put them into a list, and then match the previously divided English words. In this way, it is easy to read out the total number of C++ keywords in the code.The same is true for the second problem, and a similar approach can be used.
For the third problem, I’m going to create a list, put the words I want in it, and have them go to the list in order. This can be solved by reusing the logic code.
I thought about the fourth question for a long time, and then I came up with the method of list deletion, as long as I can find a loop in the constant reading, delete the duplicate to find the if-elseif-else structure
Instead of a single pass, I think the parser should be designed as a subroutine. Whenever the parser needs a word symbol, it passes an input string to the parser, and the parser can analyze the words in the input string.

3.Design and implementation process.

4.Code description.

def get_file():#get the file we want to getf = open(filename,'r',encoding='UTF-8')file = f.read()#Only leave the content we want to leavesymbol_list = ["+", "-", "*", "/", "<", "<=", ">", ">=", "=", "==","!=", ";", "(", ")", "^", ",", "\"", "\'", "#", "&","&&", "|", "||", "%", "~", "<<", ">>", "[", "]", "{","}", "\\", ".", ":", "!"]  #the symbols in C++for i in symbol_list:file = file.replace(i," ")#replace unwanted symbolsf.close()return file

In this code,we can read from the test code and transform it into a file which is convinent for us to work on the following steps.

And this is the result.It is expected to what I think.Very great!!!

EE308_lab1-2相关推荐

  1. EE308_Lab1

    目录 Information about Myself Abilities Programming languages Interests Weakness Amount of Code Inform ...

最新文章

  1. Spring Boot 实现万能文件在线预览
  2. 工资8000与80000的区别:这个能力值得你重视!
  3. pl sql如何调试oracle存储过程,PL/SQL Developer中调试oracle的存储过程
  4. 在DbGridEh中显示主从表
  5. iwconfig的用法
  6. linux 下oracle启动步骤
  7. AMD和CMD出生的背景和它们解决的问题
  8. 北邮王立新教授提到的“5年后运营商排名论”
  9. 网际控制报文协议ICMP(Internet Control Message Protocol)(详解)
  10. java重写面试题_Java面试题:重写了equals方法,为什么还要重写hashCode方法?
  11. oracle非归档模式与归档模式的备份
  12. 模型法在评级中的应用
  13. vivado 亚稳态_VIVADO时序约束及STA基础
  14. php视频弹幕,php超仿bilbili播放器带弹幕库后台管理系统
  15. 《网络攻防》实验九:web安全基础实践
  16. CCS+JS绘制星型拓扑图(关系图)
  17. Flink写入hdfs报错:Flink job failed with “Checkpoint Coordinator is suspending
  18. python+django+动态生成word
  19. SQL经典50查询语句(面试题)案例2
  20. ChatGPT万能工具箱 | ChatGPT辅助神器 提升了用户体验 提问回答更加精确。

热门文章

  1. PHP项目集成支付宝PC端扫码支付API(国内支付)
  2. Designing Network Design Spaces,译读
  3. [Kafka][错误: 找不到或无法加载主类 Files\Java\jdk1.8.0_101\lib\dt.jar;C:\Program]
  4. linux控制NVme硬盘点灯,硬盘点灯模式的设置方法及装置与流程
  5. LevOJ P1685飞跃悬崖(着色问题)
  6. 智能车八邻域图像算法_二
  7. 【2022年火爆的商铺共享WiFi系统源码】
  8. fabric java sdk解析channel.queryTransactionByID(txId)方法的返回值
  9. native聊天界面 react_ReactNative 聊天 App 实战|RN 仿微信界面群聊|朋友圈
  10. 语音识别(ASR)论文优选:挑战ASR规模极限Scaling ASR Improves Zero and Few Shot Learning