#include <iostream.h>
#include "SymbolTable.h"

int main(){
   SymbolTable st;
   char tmp[80];
   String cmd;
   String var;
   int val;
   while(1){
     cin>>tmp;
     cmd=tmp;
     if(cmd=="end"){
       cout<<"End of program"<<endl;
       return 0;
     }else if(cmd=="int"){
       cin>>tmp;
       var=tmp;
       st.Declare(var);
     }else if(cmd=="print"){
       cin>>tmp;
       var=tmp;
       val=st.Read(var);
       cout<<"Content of "<<var<<" is currently "<<val<<endl;
     }else if(cmd=="store"){
       cin>>tmp;
       var=tmp;
       cin>>val;
       st.Write(var,val);
     }else if(cmd=="call"){
       cin>>tmp;
       cout<<"Calling procedure "<<tmp<<endl;
       st.CallProcedure();
     }else if(cmd=="return"){
       st.ExitProcedure();
       cout<<"Procedure exited"<<endl;
     }else{
       cout<<"Wrong input format"<<endl;
     }
   }
   return 0;
}
