[Oberon] Bug in (and fix for) RX.Mod

John Drake jmdrake_98 at yahoo.com
Mon Dec 6 22:21:34 CET 2004


Hello all,

Chris Glur has been testing a program I wrote 
to enhance the built in regular expression 
program so that it can "grep" multiple files.  
He came across a bug that I hand found before,
fixed on my local machine, and promptly forgot
about.  I'm posting what I sent to him in
case someone else might also run into this 
problem.  Also this raises the question of 
how to provide for the (ever so small) Oberon
community to report and fix bugs in the source
distribution(s).

==============================================
Ok, stop the presses.  I know what's wrong.  In 
the module RXA.Mod there is a constant "nofchar" 
which is initially set to 134.  This constant is 
used to set up the dfa transition matrix 
(nofstates X nofchar).  It's fine as long as
you don't have any special charecters in your 
text beyond ASCII 134.  But if you do then you 
have such charecters in your text then the RXA 
engine traps because it's trying to find a value 
outside it's possible range.  Oh, and I figured 
out why this wasn't a problem in the WinAOS 
version.  I had already FIXED the RXA module in 
the WinAOS version!  

This bug doesn't just show up in RXEnhanced.
If you try:

RX.Grep Book.Tool "ize"

you will likely get the same trap.  The 
"offending" charecter in Book.Tool is the
accented "e" in Andre Fisher's name.

Here's the fix.  In the file RXA.Mod change 
the line:

nofchar = 134;

To:

nofchar = 256;
=================================================

Regards,

John M. Drake


		
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 




More information about the Oberon mailing list