comp.lang.ada
 help / color / mirror / Atom feed
From: Vincent Marciante <INALID_EXCEPT_FOR_marciant@earthlink.net>
Subject: Re: Ada83 -Booch regular expression
Date: Sat, 24 May 2003 19:21:19 GMT
Date: 2003-05-24T19:21:19+00:00	[thread overview]
Message-ID: <3ECFC618.28D7@earthlink.net> (raw)
In-Reply-To: 8fe5cfbb.0305210048.5526f046@posting.google.com

c-kif-kif wrote:
 
> i'm trying to do some pattern matching in Ada83 with the
> Booch regular expression components - without any success.
> Is there anyone who can give me some exemple code
> on how to instantiate and use the regular expression
> components for strings ?


A quote from page 542 of the book _SOFTWARE_COMPONENTS_WITH_ 
_Ada__Structures,_Tools,_and_Subsystems follows:


with pattern_match_regular_expression;
package character_match is
  new pattern_match_regular_expresion
     (item         => character,
      index        => positive,
      items        => string,
      any_item     => '?',
      escape_item  => '/',
      not_item     => '~',
      closure_item => '*',
      start_class  => '{'
      stop_class   => '}',
      is_equal     => "=");

Given that instantiation, we can consider writing patterns
such as:

o  rerecord               The literal string "rerecord"

o  {aeiou}??????ing       A ten character word starting
                          with a vowel and ending in "ing"

o  ~{aeiou}??????????ing  A ten character word starting
                          with anything but a vowel and
                          ending in "ing"

o  10*1                   A 1 follwed by zero or more 0's,
                          followed by a 1

o  100*1                  A 1 follwed by one or more 0's,
                          followed by a 1

o  x/*y                   The literal string "x*y"


end quote



By the way, I have the okay from Grady Booch 
(and his publisher) to put together a version
of the above mentioned book that will be
available online.  I just have not had the 
time to finish it :(

By the way, questions about the Ada 83 Booch
components may also be asked in the chat forum
at AdaPower.  That is where the Original Booch
Components are available for download and is 
where the online version of the book will 
eventually appear. The main URL is:

http://www.adapower.com/original_booch/


-- 
The first character of my real email is the "m" 
Please do not repeat it in any news messages.



  parent reply	other threads:[~2003-05-24 19:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-21  8:48 Ada83 -Booch regular expression c-kif-kif
2003-05-24 12:57 ` Craig Carey
2003-05-24 18:09   ` Pascal Obry
2003-05-25 10:47   ` Simon Wright
2003-05-24 19:21 ` Vincent Marciante [this message]
2003-05-25 18:51   ` c-kif-kif
replies disabled

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