Newsgroups: comp.lang.smalltalk
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!linus!linus!linus!sdl
From: sdl@d74sun.lyra.mitre.org (Steven D. Litvinchouk)
Subject: Re: Smalltalk scanner
In-Reply-To: bp@cs.hull.ac.uk's message of 24 May 91 22:06:17 GMT
Message-ID: <SDL.91May26104035@d74sun.lyra.mitre.org>
Sender: news@linus.mitre.org (News Service)
Nntp-Posting-Host: d74sun.mitre.org
Organization: The Mitre Corporation, Bedford, MA
References: <22808.9105242206@olympus.cs.hull.ac.uk>
Date: 26 May 91 10:40:35


In article <22808.9105242206@olympus.cs.hull.ac.uk> bp@cs.hull.ac.uk (Barry Prescott) writes:

> I have to produce a lexical analyser in Smalltalk-80 for an abstract
> document editor. I thought I could reuse the Smalltalk class
> 'Scanner', but it looks like its tuned for scanning Smalltalk. 
> 
>  Is it worth my while useing this code, or should I start from
> scratch?  Has anyone else done this?

I once had to write a scanner for an ASCII representation of "DIANA"
(an intermediate notation employed by Ada compilers and other Ada
tools).  I defined DIANAScanner as a subclass of Scanner.  I only had
to override four or five methods, including one to fix up the typeTable.
So for me it was worth it to reuse Scanner, because I was able to reuse
the same overall OO architecture of the class.

However, it was also apparent to me that some of Scanner's existing
methods were fairly long (by Smalltalk standards), and so my overrides
of those methods were also fairly long.  (I basically had to copy all
the code and make small mods to it.)


--
Steven Litvintchouk
MITRE Corporation
Burlington Road
Bedford, MA  01730
(617)271-7753
ARPA:  sdl@mbunix.mitre.org
UUCP:  ...{att,decvax,genrad,necntc,ll-xn,philabs,utzoo}!linus!sdl
	"Where does he get those wonderful toys?"
