kicad-developers team mailing list archive
Mailing list archive
Re: RS274X file format.
Dick Hollenbeck <dick@...>
Fri, 01 May 2009 06:26:24 -0500
Thunderbird 22.214.171.124 (X11/20090318)
By using exceptions, it was possible to keep the "error reporting UI
code" out of the low level parser and up at a higher calling layer where
the catch resides.
I like this solution as well. I know in the past there were some issues
using exceptions with wxWidgets. I don't know if that is still the
case. I have avoided using them to prevent portability issue between
What, I am confused. Are there are C++ compilers out there that meet
1) Don't handle exceptions
2) We want to use them
That would be an odd combination for me.
My only suggestion is to make parsers stream based for
flexibility rather than just file based.
Please elaborate on what you mean by "stream", by pointing to a specific
C++ class hierarchy. In my specctra import, I specifically abstracted
the input source by using a LineReader class. All that one would need
to do is provide an alternative line reader. That lexer/parser stack
needs lines of text, and it does not care where they come from. There
is no file I/O sprinkled throughout the code. A "line reader" is
perhaps another name for input abstraction, but I chose it because it
says what is needed, a full line of text. Obviously it would be trivial
to create an alternative line reader which gets its data from somewhere
else, from RAM for example.
Computers have so much ram nowadays there is becoming less reason to
have all kinds of abstract forms of input. It is trivial to read an
entire file into ram and then walk through it. That would be the
typical idiom in python.