comp.lang.ada
 help / color / mirror / Atom feed
From: Laurent.Guerby@enst-bretagne.fr (Laurent Guerby)
Subject: Re: Ada 83 Style Query
Date: 1996/05/07
Date: 1996-05-07T00:00:00+00:00	[thread overview]
Message-ID: <4xrasxqu0q.fsf@leibniz.enst-bretagne.fr> (raw)
In-Reply-To: 9605061517.AA05599@most


Wes writes
: 
: I'm working on some old code that has a long string of elsif checking
: strings that come in from outside against known commands.
: 
: Seeking opinions on the desirability of using an enumerated type with 'VAL
: and a case statement.  The sore spot is the need for an exception handler
: when the incoming string matches none of the literals in the command list.
: 
: What would YOU do?  And yes, "look the other way" is a viable answer. :-)

   Depending of what is on your priority list, other ways :

- hcode table (you can try some automatic "best" hcode generators).
- long list of imbricated "if", look at the GNAt lexical analysis routine. 

   Hope this helps,

-- 
--  Laurent Guerby, student at Telecom Bretagne (France), Team Ada.
--  "Use the Source, Luke. The Source will be with you, always (GPL)."
--  http://www-eleves.enst-bretagne.fr/~guerby/ (GATO Project).
--  Try GNAT, the GNU Ada 95 compiler (ftp://cs.nyu.edu/pub/gnat).




      parent reply	other threads:[~1996-05-07  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-05-06  0:00 Ada 83 Style Query W. Wesley Groleau (Wes)
1996-05-06  0:00 ` John Herro
1996-05-06  0:00 ` Theodore E. Dennison
1996-05-07  0:00 ` Laurent Guerby [this message]
replies disabled

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