Compare commits
No commits in common. "f0622cbb3f237686044e84ff32e2fea2784d6450" and "25de035bb7e8f4441055c1870452abfcf3e6d9c2" have entirely different histories.
f0622cbb3f
...
25de035bb7
@ -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
2
.gitignore
vendored
@ -1,3 +1 @@
|
|||||||
build/
|
build/
|
||||||
.cache/
|
|
||||||
|
|
||||||
|
8
lexer.l
8
lexer.l
@ -26,13 +26,17 @@
|
|||||||
// boilerplate for this small example. Bummer.
|
// 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]+ {
|
[a-z]+ {
|
||||||
std::cout << "Scanner: identifier [" << yytext << "]\n";
|
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 */ ));
|
||||||
}
|
}
|
||||||
|
|
||||||
\( {
|
\( {
|
||||||
|
5
main.cpp
5
main.cpp
@ -1,7 +1,7 @@
|
|||||||
#include "interpreter.hpp"
|
#include <iostream>
|
||||||
#include "lexer.hpp"
|
#include "lexer.hpp"
|
||||||
#include "parser.hpp"
|
#include "parser.hpp"
|
||||||
#include <iostream>
|
#include "interpreter.hpp"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@ -10,3 +10,4 @@ int main()
|
|||||||
std::cout << "Prase completed with result: " << result << '\n';
|
std::cout << "Prase completed with result: " << result << '\n';
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user