F
fabricemarchant
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
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