Hello! Please i am searching for a way to calculate the length of a matched string in yacc. Here is the a short simplified version of the scenario:

char *p;

"string :"  { BEGIN sString; }

<sString>.+   {
	                p = (char *)calloc(strlen(yytext)+1, sizeof(char));
                        strcpy(p, yytext);
                        yylval.sValue = p;
                        return TEXT;
Now in my Yacc file i have:

	    	/*Here i need to get the actual string that is passed after the 
                  "name =" and output it to yyout then calculating it's length 
                  and storing it in a global variable. */ 
Please any suggestions are highly appreciated! Thanks a lot for all your time and support!