fuck yeah

This commit is contained in:
bronku 2025-11-21 09:43:40 +01:00
parent 05ba6f6e7f
commit 4d16b6fb08
3 changed files with 14 additions and 15 deletions

View file

@ -8,17 +8,20 @@
%code requires {
#include <string>
class Scanner; // Forward declaration
}
%code {
#include <iostream>
#include "../src/scanner.hpp"
int scanner_lex(yy::parser::semantic_type* yylval);
// Define yylex to use the scanner's lex method
#undef yylex
#define yylex scanner_lex
#define yylex scanner->lex
}
%parse-param { Scanner* scanner }
%token <std::string> WORD
%token NUMBER
%token CHAR
@ -36,7 +39,6 @@ element:
;
%%
namespace yy {
void parser::error(const std::string& msg)
{