I am trying to define two tokens in flex. First one returns "tINTTYPE", which returns when it sees the string "int" in the input, and other one is "TINTTYPE", which returns when it sees "int matrix" in the input.
Here is the related part of my flx file:
int {yylval.type_id.Type=1;return tINTTYPE;}
int[ \t\n]+matrix {yylval.type_id.Type=2;return tINTMATRIXTYPE;}
. return yytext[0];
The problem is, when the input is int matrixm=4; the scanner recognizes it as int matrix m=4; and returns tINTMATRIXTYPE, but in reality, we have an integer type named matrixm, and i want it to be recognized as this, i.e it shuld return tINTTYPE. What can i do about this?
Thank you