![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
词法分析学习
wkkkkkw
这个作者很懒,什么都没留下…
展开
-
识别字符串中所有的*号
void classfyOp0(string str) { string Op[]={"+","-","*","!","=","<",">","&&","+="}; int len = sizeof(Op)/sizeof(Op[0]); string oldstr = str; string nochange = str; string newstr; int storeRes[20]; int site = 0; int OpSite = 0; int o.原创 2020-06-21 22:47:42 · 471 阅读 · 0 评论 -
词法分析识别数字和关键字
输入字符串来识别,但目前还未实现跳过回车以及空格功能。 #include <iostream> #include <cstring> #include <stdlib.h> #include <sstream> using namespace std; string str[1000]; string numstr[100]; int index=0; template <class Type> Type stringToNum(con原创 2020-06-20 21:29:26 · 1059 阅读 · 1 评论