hi all,
One of the shortfalls in writing parsing routines I've found recently is
that there is no native regex handling stuff in GRASS. (is there?). I
considered using the posix librx to provide this, perhaps with useful
wrapper functions that give the handling routines a simpler interface
for users to work with, as the regcomp/regexec etc. business can be a
pain. Does anyone know of any problems with rx, eg unsupported
platforms? If so, are there alternatives that are more acceptable? The
functionality would be very useful where routines have been initially
developed in scripts and have to be moved to C-code to be part of new
modules or library routines.
If it is OK, I would like to propose that this be incorporated into
GRASS 5.1, maybe with the rx library bundled (as it's not standard in
installations even though it is used by many software packages).
David
----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'
On Tue, Apr 17, 2001 at 09:16:01PM +0100, David D Gray wrote:
hi all,
One of the shortfalls in writing parsing routines I've found recently is
that there is no native regex handling stuff in GRASS. (is there?). I
considered using the posix librx to provide this, perhaps with useful
wrapper functions that give the handling routines a simpler interface
for users to work with, as the regcomp/regexec etc. business can be a
pain. Does anyone know of any problems with rx, eg unsupported
platforms? If so, are there alternatives that are more acceptable? The
functionality would be very useful where routines have been initially
developed in scripts and have to be moved to C-code to be part of new
modules or library routines.
If it is OK, I would like to propose that this be incorporated into
GRASS 5.1, maybe with the rx library bundled (as it's not standard in
installations even though it is used by many software packages).
GNU libc6 provides native POSIX regex handling. Don't know about librx,
found a librxp but its a metalanguage thingy for XML parsing ??
--
Eric G. Miller <egm2@jps.net>
----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'
David D Gray wrote:
One of the shortfalls in writing parsing routines I've found recently is
that there is no native regex handling stuff in GRASS. (is there?).
Do the regexps need to be constructed at run-time? If not, I would
have thought that it would be better to write the parser using (f)lex.
--
Glynn Clements <glynn.clements@virgin.net>
----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'
"Eric G. Miller" wrote:
[...]
GNU libc6 provides native POSIX regex handling. Don't know about librx,
found a librxp but its a metalanguage thingy for XML parsing ??
Eric
It seems to be largely the same library. Posix Rx seems to have been
mostly incorporated into glibc. Just calls a different header regex.h v.
rxposix.h
David
----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'
Glynn Clements wrote:
David D Gray wrote:
> One of the shortfalls in writing parsing routines I've found recently is
> that there is no native regex handling stuff in GRASS. (is there?).
Do the regexps need to be constructed at run-time? If not, I would
have thought that it would be better to write the parser using (f)lex.
Mostly flex is used now where whole files are being scanned for input,
but there are instances where it is required to search for patterns in
an isolated string, and in those instances lex is cumbersome or just not
practical. For example, you might want to define a function G_gsub:
int G_gsub(char *pattern, char *replacement, char *str, int flags)
that is like the AWK function and replaces a matching pattern with a
replacement string. This would have to call the regex routines.
I find it is often useful to develop code in perl scripts and then when
that is working port to C, or if it's necessary to take code and move it
from modules to library routines. Most of the functionality is easy to
port, but basic regex functioning is the most difficult.
David
----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'