Path: utzoo!attcan!uunet!husc6!bloom-beacon!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: comp.lang.c Subject: Re: State Machines (was Re: gotos) Message-ID: <1103@mcgill-vision.UUCP> Date: 16 May 88 08:04:05 GMT References: <1945@sugar.UUCP> Organization: McGill University, Montreal Lines: 20 Posted: Mon May 16 04:04:05 1988 In article <1945@sugar.UUCP>, peter@sugar.UUCP (Peter da Silva) writes: > I submit that there is one case where gotos are no worse and possibly > better than the alternative. And that is state machine type code, as > is found in lexers. Ideally, one should use a real lexer language. If you have C on the target machine, and you have a UNIX machine available for development, and you are scanning out of a string (as opposed to a stdio stream), I have something which may be able to help. It takes input describing something like a finite state machine (it isn't quite a vanilla FSM, as one might encounter in a theory class) and produces C code to implement it. It was patterned after the VMS lib$tparse facility, but is somewhat more powerful. Mail if interested, der Mouse uucp: mouse@mcgill-vision.uucp arpa: mouse@larry.mcrcim.mcgill.edu