[Oberon] Bug in (and fix for) RX.Mod
jmdrake_98 at yahoo.com
Mon Dec 6 22:21:34 CET 2004
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
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
nofchar = 134;
nofchar = 256;
John M. Drake
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
More information about the Oberon