fgets & fgetc stops when it reaches a ^z character (eof character) ^d on unix. the batch mode flex does not I think do this, because it uses fread. however, it might if you open the file in text mode instead of binary. If you happen to want to lex a ^z or ^d this can be a problem!
will I need to redefine YY_INPUT in the case of a C++ lexer and parser? The C++ lexer uses <iostream> (hence fstream) rather than <stdio.h>. this is what I gathered from bison & flex 2.1 generated code. how do I keep this on the mailing list? by forwarding it to [EMAIL PROTECTED] Jim Michaels [EMAIL PROTECTED] http://JesusnJim.com ----- Original Message ---- From: Laurence Finston <[EMAIL PROTECTED]> To: Jim Michaels <[EMAIL PROTECTED]> Sent: Monday, October 13, 2008 3:30:23 AM Subject: Re: problems with bison-flex Another thing is that I had to redefine `YY_INPUT' as explained in the Flex manual: #define YY_INPUT(buf,result,max_size) \ { \ signed char c = (signed char) fgetc(yyin); \ result = (c == EOF) ? YY_NULL : (buf[0] = c, 1); \ } This way, one character is read at a time. I'm assuming that `fgetc' uses block reads --- I certainly hope so. By the way, I'd appreciate it if you kept any further discussion on the mailing list, so other people with the same questions can benefit from it. Thanks. The help-bison archives can be found here: http://lists.gnu.org/archive/html/help-bison/ Laurence Finston _______________________________________________ help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison