Passing a pointer to Scanner instead of reference.

This way, we can handle std::cin easier.
This commit is contained in:
Stefano Sanfilippo 2015-03-05 00:58:30 +01:00
parent 0cf45c87b4
commit eba0efb878
2 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ namespace monicelli {
class Scanner: public yyFlexLexer { class Scanner: public yyFlexLexer {
public: public:
Scanner(std::istream &in): yyFlexLexer(&in) {} Scanner(std::istream *in): yyFlexLexer(in) {}
int yylex(Parser::semantic_type *lval, Parser::location_type *loc) { int yylex(Parser::semantic_type *lval, Parser::location_type *loc) {
this->lval = lval; this->lval = lval;

View File

@ -27,7 +27,7 @@ using namespace monicelli;
int main(int argc, char **argv) { int main(int argc, char **argv) {
Program program; Program program;
Scanner scanner(std::cin); Scanner scanner(&std::cin);
Parser parser(scanner, program); Parser parser(scanner, program);
#if YYDEBUG #if YYDEBUG