minor fixes

This commit is contained in:
Simon 2024-07-19 00:22:38 +02:00
parent a52fd95965
commit f0622cbb3f
4 changed files with 8 additions and 10 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
build/
.cache/

View File

@ -26,17 +26,13 @@
// boilerplate for this small example. Bummer.
%}
%option nodefault
%option noyywrap
%option c++
%option yyclass="Lexer"
%option prefix="stela_"
%option nodefault noyywrap noyylineno c++ yyclass="Lexer" prefix="stela_"
%%
[a-z]+ {
std::cout << "Scanner: identifier [" << yytext << "]\n";
return stela::Parser::make_STRING(yytext, stela::location( /* put location data here if you want */ ));
return stela::Parser::make_STRING(yytext, stela::location());
}
\( {

View File

@ -1,7 +1,7 @@
#include <iostream>
#include "interpreter.hpp"
#include "lexer.hpp"
#include "parser.hpp"
#include "interpreter.hpp"
#include <iostream>
int main()
{
@ -10,4 +10,3 @@ int main()
std::cout << "Prase completed with result: " << result << '\n';
return result;
}

View File

@ -1,5 +1,6 @@
%skeleton "lalr1.cc"
%require "3.8"
%require "3.8.2"
%defines
%define api.parser.class { Parser }
%define api.token.constructor