From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,affd14e05b8fb09a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-04-29 08:19:23 PST Path: archiver1.google.com!news1.google.com!news.glorb.com!news.agarik.com!news.agarik.com!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Marius Amado Alves Newsgroups: comp.lang.ada Subject: Re: Hierarchical States Machines Date: Thu, 29 Apr 2004 16:41:10 +0100 Organization: Cuivre, Argent, Or Message-ID: References: Reply-To: amado.alves@netcabo.pt NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: melchior.cuivre.fr.eu.org 1083251963 74552 212.85.156.195 (29 Apr 2004 15:19:23 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Thu, 29 Apr 2004 15:19:23 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: User-Agent: KMail/1.4.3 In-Reply-To: X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:7566 Date: 2004-04-29T16:41:10+01:00 On Thursday 29 April 2004 04:58, Steve wrote: > I don't have anything against using goto's for state machines... but... > > I usually set up an enumeration for each state: > > type my_states is ( start_state, initializing, etc, end_state );... That's how I usually do it too. See http://www.liacc.up.pt/~maa/files/Ada_Automaton/ for an Ada tokenizer written this way. Programs Ada_Automaton_Test and=20 Ada_Counter are example applications of the package. Ada_Counter counts t= he=20 significant semicolons in a unit.