[antlr-interest] ANTLr and streams

drxenos spamjunk at stny.rr.com
Sat Apr 19 16:08:34 PDT 2003


Hi.  I'm having an "interesting" problem.  I'm using ANTLr 2.7.2
generating C++ code, and GCC 3.2 (MINGw).  In order to simplify my
testing, I was trying to feed my lexer with an istringstream.  The
lexer works fine with an ifstream.  With an istringstream, it throws
an exception stating "expecting EOF," but the C++ standard says that
an istringstream will fail as any i/o stream when the end is reached.
 The lexer's constructor only expects an istream, so either should
work.  I can't tell whether it is the ANTLr C++ code or GCC that's
causing the failure.  The only thing I can think of is that "failure"
at the end-of-string means setting the fail bit but not the eof bit,
and the ANTLr code is looking explicitedly for the eof bit.

Anyone got any info or ideas on this problem?

Thanks,

Rich


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list