Title : Design suitable data structures and implement Pass 1 of two pass macro-processor CODE #include #include using namespace std; int main(){ vector mdt; vector mnt; vector pnt[4]; fstream file; int pointer=0; file.open("macro.txt",ios::in); string s = "",str=""; int c = 0,r=0,a=-1,b=0; while(getline(file,s)){ if(s=="MACRO"){ b=1; c=1; a++; continue; } for(auto it:s){ if(r==1){ int z=0; for(auto x:pnt[a]){ if(x==it){ z=1; } } if(z==0){ pnt[a].push_back(it); } r=0; } if(it=='&'){ r=1;} } if(b==1){ str=""; int v=0; char t=s[v]; while(t!=' '){ str=str+t; v++; t=s[v]; } mnt.push_back(str); b=0; } if(c==1){ mdt.push_back(s); } if(s=="MEND"){ c=0; } } file.close(); cout<<"MDT"<