%{
#include <iostream>
#include <cstdlib>
#include "bisoncalc.tab.hpp"
using namespace std;

YYSTYPE yylval;
%}

%option noyywrap

%%

[-]?[0-9]+  { yylval.val = atoi(yytext); return NUM; }
[+-]        { yylval.sym = yytext[0]; return OPA; }
[*/]        { yylval.sym = yytext[0]; return OPM; }
"("         { return LP; }
")"         { return RP; }
";"         { return STOP; }
<<EOF>>     { return YYEOF; }
[ \t\n]+    { }
.           { cerr << "Unrecognized token starting with '" << yytext[0] << "'" << endl; return YYerror; }
%%