This repository has been archived on 2024-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
pacciani/Scanner.hpp

29 lines
442 B
C++
Raw Normal View History

2014-11-28 19:01:15 +01:00
#ifndef SCANNER_HPP
#define SCANNER_HPP
#ifndef yyFlexLexerOnce
#include <FlexLexer.h>
#endif
#include "Parser.hpp"
namespace monicelli {
class Scanner: public yyFlexLexer {
public:
Scanner(std::istream &in): yyFlexLexer(&in), lval(nullptr) {}
int yylex(Parser::semantic_type *lval) {
this->lval = lval;
return yylex();
}
private:
int yylex();
Parser::semantic_type *lval;
};
} // monicelli
#endif