%{
#include <stdio.h>
#include "y.tab.h"  // If used with yacc/bison, needed for token definitions
%}

%%

"i"             { return ID; }
"+"             { return PLUS; }
"*"             { return MUL; }
"("             { return LPAREN; }
")"             { return RPAREN; }
[ \t\n]+        { /* skip whitespace */ }
.               { printf("Invalid character: %s\n", yytext); }

%%

int yywrap() {
    return 1;
}