diff --git a/.gitignore b/.gitignore index 567609b..1be61f5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ build/ +.cache/ + diff --git a/lexer.l b/lexer.l index 7458e26..ab6cce8 100644 --- a/lexer.l +++ b/lexer.l @@ -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()); } \( { diff --git a/main.cpp b/main.cpp index 89ce4a9..65d07c5 100644 --- a/main.cpp +++ b/main.cpp @@ -1,7 +1,7 @@ -#include +#include "interpreter.hpp" #include "lexer.hpp" #include "parser.hpp" -#include "interpreter.hpp" +#include int main() { @@ -10,4 +10,3 @@ int main() std::cout << "Prase completed with result: " << result << '\n'; return result; } - diff --git a/parser.y b/parser.y index 2be43ef..bc2e057 100644 --- a/parser.y +++ b/parser.y @@ -1,5 +1,6 @@ %skeleton "lalr1.cc" -%require "3.8" +%require "3.8.2" + %defines %define api.parser.class { Parser } %define api.token.constructor