with reference to How to tokenize String in Lex and Yacc but in this post i am looking for integer token
when i am getting input
a_2 = _6 + b_3;
in the lex file i want to get a_2 as integer type token, how can i get this token below is my lex file
%{
/*
parser for ssa;
*/
#include<stdio.h>
#include<stdlib.h>
#include"y.tab.h"
%}
%%
[\t]+ ;
\n ;
"if" printf("first input\n");
"else" return(op);
"=" return(equal);
"+" return(op);
"*" return(op);
"-" return(op);
[\<][b][b][ ]+[1-9][\>] {return(bblock);}
([[_][a-z]])|([a-z][_][0-9]+)|([0-9]+) { yylval=atoi(yytext); return(var);}
. ;
%%
this is giving some binary value in digit