By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,797 Members | 1,848 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,797 IT Pros & Developers. It's quick & easy.

Uniform input stream from various kind of sources ?

P: n/a
Hi !

I'm writing a tiny interpreted language. The interpreter will first
be able to load a list of source files before giving the hand to the
keyboard : I use GNU readline/history library that returns the line
input string that could be converted into a stream by std::istrstream.

My aim is to cut the interpreter from this input system by feeding it
with a unique input stream.
Maybe I could use <sstream> to build this input stream. It is
maybepossible inside a buffered input to switch from one source file
to another one and then to the istrstream of readline() ?

I have always neglected to seriously study input / output streams and
always used them in a poor basic way... it's a shame since they do
carry a powerful abstraction feature that can make the things a lot
easier.

Please can you give me an idea of a frame to build this unified input
stream ?

Thanks in advance.

Fabrice

Jun 20 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
In article <1150831977.842063.152980
@r2g2000cwb.googlegroups.com>, fa*************@free.fr
says...
Hi !

I'm writing a tiny interpreted language. The interpreter will first
be able to load a list of source files before giving the hand to the
keyboard : I use GNU readline/history library that returns the line
input string that could be converted into a stream by std::istrstream.

My aim is to cut the interpreter from this input system by feeding it
with a unique input stream.


I've have the interpreter use an input iterator, and
create a custom iterator that reads from some current
stream, and switches to a different stream when needed.

--
Later,
Jerry.

The universe is a figment of its own imagination.
Jun 21 '06 #2

P: n/a
A week later...

Apologize, my 56k modem was actually destroyed wednesday by a flash
lightning. It happens.

I've followed your adviice, Jerry : implemented in switching like you
said.

Thanx Jerry !

Jun 26 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.