fixed scanner.hpp

This commit is contained in:
bronku 2025-11-21 09:14:35 +01:00
parent 0018a97b1e
commit 05ba6f6e7f
4 changed files with 18 additions and 9 deletions

View file

@ -1,4 +1,10 @@
#pragma once
// fucking piece of shit flex, doesn't even have proper macro directives
#ifndef yyFlexLexer
#include <FlexLexer.h>
#endif
#include "../build/parser.hpp"
#include <string>
@ -9,8 +15,6 @@ class Scanner : public yyFlexLexer
public:
Scanner(std::istream *in) : yyFlexLexer(in) {}
int yylex();
int lex(yy::parser::semantic_type *yylval)
{
this->yylval = yylval;
@ -18,11 +22,8 @@ public:
}
private:
virtual int yylex();
yy::parser::semantic_type *yylval;
};
int scanner_lex(yy::parser::semantic_type *yylval)
{
static Scanner scanner(&std::cin);
return scanner.lex(yylval);
}
int scanner_lex(yy::parser::semantic_type *yylval);