%option noyywrap %{ #include #define YY_DECL int yylex() #include "assembler.tab.h" %} %% [ \t] ; // ignore all whitespace [0-9]+ {yylval.ival = atoi(yytext); return T_INT;} \n {return T_NEWLINE;} "LOAD" {return T_LOAD;} "STORE" {return T_STORE;} "CLEAR" {return T_CLEAR;} "exit" {return T_QUIT;} "quit" {return T_QUIT;} %%