paring binary files - basic understanding question of the OO Way

Markus Gaelli gaelli at emergent.de
Fri Aug 6 13:01:52 UTC 2004


Hi Guenther,

maybe you want to use a Parser Generator like SmaCC, available on 
SqueakMap
(SmaCC Smalltalk Compiler-Compiler-Development)

Info about SmaCC on http://www.refactory.com/Software/SmaCC,
especially on http://www.refactory.com/Software/SmaCC/Scanner.html how 
to scan binary data (hex-chars).

But maybe the easiest for you would to export the excel files as comma 
separated files,
and then just parse them (assumed you have them in a string) a la:
('a,b
c,d' findTokens: (String with: Character cr))  collect: [:aLine | aLine 
findTokens: ',']

Hope that helps,

Markus

On Aug 6, 2004, at 14:29, Guenther Schmidt wrote:

> Hi,
>
> I'm trying to write a parser for binary files (excel) and wow! I've 
> already figured out how to use streams ;-).
>
> Now comes a problem with basic understanding of OO.
>
> As I read from the stream byte by byte how can I 'parse' the byte i.e. 
> give it it's meaning or create the proper object?
>
> Does it realy come down to if byte = xxx ... else ... else ...? I mean 
> this doesn't seem very OO to me.
>
> Please help.
>
> Regards
>
> Guenther
>
>




More information about the Squeak-dev mailing list