1

I want to send duplicate string to my bison file.

In my flex file I use it like this

    "<"     {return strdup(tOPEN);}

    ">"     {return strdup(tCLOSE);}

Is this right things to do? Or should I use it like below the code.

    "<"       { yyval. sval = strdup(yytext); return tOPEN;}
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
M.J.Watson
  • 470
  • 7
  • 18

1 Answers1

2
  "<"       { yyval. sval = strdup(yytext); return tOPEN;}

this is the right way of the using.

M.J.Watson
  • 470
  • 7
  • 18