Le 23 sept. 2013 à 16:28, 王波 <wangbo15541...@hotmail.com> a écrit :
> Demaille, Akim is my first name. > Now I have another question. > > When Flex reads "EOF", but I want to judge the former character, if it's > "\n", I will terminate, otherwise I will let Flex read a "\n", then > terminate. > > Now, I resolve it by using "yy_scan_string" and appending "\n" for all "EOF" > . About appending "\n", I realize it by adding a flag to judge if it's the > first time to add. > I think it's not a good solution. > > Is there a good way to resolve it? > I think Flex should support a variable or function to resolve it( like > less(), but how to replace some unexpected characters). I don't know offhand a good means to do that. Would it be a problem is <<EOF>> always emitted a \n before ending? Anyway, this is about Flex/Lex, not about Bison, so this is not the right place. Cheers, Akim _______________________________________________ help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison