#include #include #include #include using namespace std; #include #include #define size 200 struct word { char data[20]; char sign[10]; int aa; int bb; float num; }; typedef struct node { int style; int data; struct node *next; }linkstack; linkstack *top; string analysis[55][30]; char V[31]={'m','(',')','{','}',',',';','a','c','t','f','l ','i','w','d','+','-','*','/','=','T','X','Y','Z','S','E','L','A','F','#','P'}; char act[24]={'P','T','T','X','Y','Y','Y','Y','Z','Z','S','S','S','S','L','L','E','E','E','A','A','A','F','F'}; int act1[24]={8,1,3,2,1,1,1,1,1,3,4,3,5,6,1,2,3,3,1,3,3,1,3,1}; struct word w[size]; string s[40]={"auto","break","case","char","const","continue","default","do","double","else","enum","extern","float", "for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch", "typedef","union","unsigned","void","volatile","while"}; ','i','w','d','+','-','*','/','=','T','X','Y','Z','S','E','L','A','F','#','P'}; char act[24]={'P','T','T','X','Y','Y','Y','Y','Z','Z','S','S','S','S','L','L','E','E','E','A','A','A','F','F'}; int act1[24]={8,1,3,2,1,1,1,1,1,3,4,3,5,6,1,2,3,3,1,3,3,1,3,1}; struct word w[size]; string s[40]={"auto","break","case","char","const","continue","default","do","double","else","enum","extern","float", "for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch", "typedef","union","unsigned","void","volatile","while"};