#include #include #include #include "evaluate.h" #include "parser.h" using namespace std; string readstream(istream &in){ string res; char buf[4096]; while(true){ in.read(buf,sizeof(buf)); if(in.gcount()==0)break; res.append(buf,in.gcount()); } return res; } int main(int argc,char **argv){ string source,filename; bool fromstdin=false; if(argc==1)fromstdin=true; else if(argc==2){ if(strcmp(argv[1],"-")==0)fromstdin=true; else filename=argv[1]; } else { cerr<<"Pass source on stdin, or filename as argument (or '-' for stdin)"<