%{
#include "Cycript.tab.hh"
typedef cy::parser::token tk;
+#define YY_EXTRA_TYPE CYParser *
%}
%option prefix="cy"
%option yylineno
%option nounput
%option interactive
+%option reentrant
delim [ \t]
whitesp {delim}+
"(" return tk::OpenParen;
")" return tk::CloseParen;
+
"{" return tk::OpenBrace;
"}" return tk::CloseBrace;
+
"[" return tk::OpenBracket;
"]" return tk::CloseBracket;
[0-9]+ return tk::NumericLiteral;
[ \t\n] ;
+
+%%
+
+void CYParser::ScannerInit() {
+ cylex_init(&scanner_);
+ cyset_extra(this, scanner_);
+}
+
+void CYParser::ScannerDestroy() {
+ cylex_destroy(scanner_);
+}