%{ #define SKIP_FLEXLEXER_ #include "scanner.ih" #include "../parser/preinclude.h" #include "../parser/parserbase.h" %} %option yyclass="Scanner" outfile="yylex.cc" %option c++ 8bit warn noyywrap yylineno %option debug %% [ \t]+ // skip white space \n // same [0-9]+ { *d_semval = Semantic(Semantic::INT, yytext); return Parser::INT; } [a-zA-Z_][a-zA-Z0-9_]* { *d_semval = Semantic(Semantic::IDENTIFIER, yytext); return Parser::IDENTIFIER; } . return yytext[0]; %%