- 博客(0)
- 资源 (2)
- 收藏
- 关注
世界知识产权组织GII指标
GII(Global Innovation Index),由世界知识产权组织WIPO(world intellectual property organization)、美国康奈尔大学、欧洲工商管理学院及其他工商业界合作伙伴共同发布。
《2019年全球创新指数》,根据2019年的GII,瑞士是全世界最具创新性的国家,其次是瑞典、美利坚合众国(美国)、荷兰和联合王国(英国)。
2020-08-10
递归下降分析.rar
递归下降分析 语法分析器
#include <iostream>
using namespace std;
char token[50];
int ch=0;
int sign;
void E();
void E1();
void T();
void T1();
void F();
int main()
{
sign=1;
cout<<"请输入要分析的字符串,以$结束: ";
cin>>token;
cout<<endl;
E();
if((token[ch]=='$')&&sign)
cout<<"分析成功!"<<endl;
else
cout<<"分析失败!"<<endl;
return 0;
}
void E()
{
cout<<"E=>TE'"<<endl;
T();
E1();
}
void E1()
{
if(token[ch]=='+')
{
cout<<"E'=>+TE'"<<endl;
ch++;
T();
E1();
}
else
cout<<"T'=>^"<<endl;
}
void T()
{
cout<<"T=>FT'"<<endl;
F();
T1();
}
void F()
{
if(token[ch]=='i')
{
cout<<"F=>i"<<endl;
ch++;
}
else
{
if(token[ch]=='(')
{
cout<<"F=>(E)"<<endl;
ch++;
E();
}
else if(token[ch]==')')
{
cout<<"F=>(E)"<<endl;
ch++;
}
else
sign=0;
}
}
void T1()
{
if(token[ch]=='*')
{
cout<<"T'=>*FT'"<<endl;
ch++;
F();
T1();
}
else
cout<<"T'=>^"<<endl;
}
2010-06-28
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人