[Oberon] Re (2): Detecting whether a Text is a module source.

Douglas G Danforth danforth at greenwoodfarm.com
Mon Jan 30 00:57:25 CET 2017


Lyall,
Build a finite state machine that examines each input character only once.
To avoid missing embedded words ("Mississippi") the machine must be
smart.  I use an algorithm called X-Search developed at Stanford by
a graduate student of Donald Knuth.  It allows for parallel searches
for many words simultaneously (e.g. "Hello", "Goodbye", "yesterday").
-Doug Danforth

On 1/29/2017 8:10 AM, peter at easthope.ca wrote:
>> According to the EBNF for O7, the smallest legal module ...
> OK, thanks.  Will keep in mind for later. For now I'm concerned only
> with detecting the presence of a word in a text; not with conformity
> to a syntax.
>
> What is efficient code to find whether the word "Jaguar" is present
> in a text for example?  There are many ways of varying efficiency.  A
> compiler must have a solution but I'm unlikely to recognize it.  Can
> anyone give a code example or direct me to one?
>
> Thanks,                                 ... Lyall E.
>
>
>

-- 
Danforth of the Greenwood
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20170129/24cde182/attachment.html>


More information about the Oberon mailing list