Here is a simple but complete example showing a way to process both ints and strings using a union (yylval). Note that I may not have understood all your rules/regex requirements, but this should get you started.
Lexer file: example.l
%{
#include "y.tab.h"
%}
SSAINTEGER [a-z\_0-9]*\_[0-9]+
%option noyywrap
%%
[0-9]+ { yylval.number = atoi(yytext); return NUMBER; }
{SSAINTEGER} { yylval.string = strdup(yytext); return SSANUMBER; }
[ \t\n]+ /* eat up whitespace */
%%
Parser file example.y
%{
#include<stdio.h>
void yyerror (char const *s) {
fprintf (stderr, "%s\n", s);
}
%}
%union {
char * string;
int number;
}
%type <string> SSANUMBER
%type <number> NUMBER
%token NUMBER SSANUMBER
%%
myinputs: myinput
| myinput myinputs
myinput : NUMBER { printf("Number: %d\n", $1); }
| SSANUMBER { printf("SSA Number: %s\n", $1); }
;
%%
int main()
{
return yyparse();
}