Changed the workings of the program so that a global stringstream is written to everytime yylex matches a regex