From eba0efb87828f570f639dadfa4be9f12a39259b2 Mon Sep 17 00:00:00 2001 From: Stefano Sanfilippo Date: Thu, 5 Mar 2015 00:58:30 +0100 Subject: [PATCH] Passing a pointer to Scanner instead of reference. This way, we can handle std::cin easier. --- Scanner.hpp | 2 +- main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Scanner.hpp b/Scanner.hpp index 6d015b7..cda90f6 100644 --- a/Scanner.hpp +++ b/Scanner.hpp @@ -30,7 +30,7 @@ namespace monicelli { class Scanner: public yyFlexLexer { public: - Scanner(std::istream &in): yyFlexLexer(&in) {} + Scanner(std::istream *in): yyFlexLexer(in) {} int yylex(Parser::semantic_type *lval, Parser::location_type *loc) { this->lval = lval; diff --git a/main.cpp b/main.cpp index 80f690e..5a54e2a 100644 --- a/main.cpp +++ b/main.cpp @@ -27,7 +27,7 @@ using namespace monicelli; int main(int argc, char **argv) { Program program; - Scanner scanner(std::cin); + Scanner scanner(&std::cin); Parser parser(scanner, program); #if YYDEBUG