Compare commits

..

No commits in common. "f0622cbb3f237686044e84ff32e2fea2784d6450" and "25de035bb7e8f4441055c1870452abfcf3e6d9c2" have entirely different histories.

5 changed files with 10 additions and 22 deletions

View File

@ -1,14 +0,0 @@
BasedOnStyle: WebKit
IndentWidth: 4
ColumnLimit: 80
IndentCaseLabels: true
BreakBeforeBraces: Custom
BraceWrapping:
AfterFunction: true
SplitEmptyFunction: false
AlignAfterOpenBracket: BlockIndent
AlignOperands: AlignAfterOperator
BreakBeforeBinaryOperators: true
BinPackArguments: false
BinPackParameters: false

2
.gitignore vendored
View File

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

View File

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

View File

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

View File

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