Add semantic passes

This commit is contained in:
2024-12-23 13:54:11 +01:00
parent f080b75c52
commit 40306ac986
27 changed files with 1220 additions and 325 deletions

View File

@@ -3,10 +3,10 @@
#define YY_USER_ACTION this->location.columns(yyleng);
#include <sstream>
#include "parser.hpp"
#include "parser.hh"
#undef YY_DECL
#define YY_DECL yy::parser::symbol_type elna::source::lexer::lex()
#define YY_DECL yy::parser::symbol_type elna::source::lexer::lex(elna::source::driver& driver)
#define yyterminate() return yy::parser::make_YYEOF(this->location)
%}
@@ -126,6 +126,6 @@ false {
std::stringstream ss;
ss << "Illegal character 0x" << std::hex << static_cast<unsigned int>(yytext[0]);
throw yy::parser::syntax_error(this->location, ss.str());
driver.error(this->location, ss.str());
}
%%