comp.lang.ada
 help / color / mirror / Atom feed
From: Emmanuel Briot <briot@gnat.com>
Subject: Re: Regular expressions???
Date: Tue, 03 Jul 2001 08:25:58 GMT
Date: 2001-07-03T08:25:58+00:00	[thread overview]
Message-ID: <l8k81qs9kb.fsf@berlin.int.act-europe.fr> (raw)
In-Reply-To: mailman.994064105.29813.comp.lang.ada@ada.eu.org

"M. A. Alves" <maa@liacc.up.pt> writes:
> > If you are going to hunt around for a RE package in Ada, you can also hunt
> > around for an XML package.


You could have a look at
    http://libre.act-europe.fr.

We have made one public release of a beta XML parser, that accepts all
constructions in XML. It has support for SAX and DOM as well (ie you can either
use callbacks to parse the XML stream or build a tree and then manipulate it).

It was noted earlier than an XML parser is much easier to program than a RE
parser. Obviously, this is true. However, writing a parser from scratch is
actually not so simple, since the XML standard is pretty extensive. Support for
entities (&name;), DTDs, ... was kind of a time-consuming task :-)

Feel free to contribute to this package if you think there are some things
missing. I will release a new version hopefully soon, with a much improved
parser (twice as fast) and better support for DTDs (as well as conditional
sections in DTDs, that were not supporting in that first release).



> Also note that GNAT comes with an 'alternative' pattern matching facility
> that is more powerfull then REs: GNAT.Spitbol .

There are three regular expression (or similar) packages in GNAT:

  GNAT.Regexp: simple regular expressions (you can't get the string matched by
       a parenthesis pair), on a whole string (not part of a string).

  GNAT.Regpat: PERL-like regular expressions (basically, we were really inspired
       by the C code from Perl. There are a few known issues in 3.13, that are
       fixed in 3.14

  GNAT.Spitbol: even more powerful syntax. I have never used it personnaly, so
       can't comment on it.

Have a look at the files  g-regexp.ads, g-regpat.ads and g-spitbol.ads for a full
and extensive documentation on these three packages.

Emmanuel



  reply	other threads:[~2001-07-03  8:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-29  9:23 Regular expressions??? Michael Andersson
2001-06-29 10:05 ` David C. Hoos, Sr.
2001-06-29 16:13 ` Ray Blaak
2001-07-02  9:54   ` M. A. Alves
2001-07-03  8:25     ` Emmanuel Briot [this message]
2001-07-04  4:53       ` Ray Blaak
2001-06-30 14:49 ` Florian Weimer
2001-06-30 20:38 ` R. Srinivasan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox