State Machines (was Re: gotos)

der Mouse mouse at mcgill-vision.UUCP
Mon May 16 18:04:05 AEST 1988


In article <1945 at sugar.UUCP>, peter at 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 at mcgill-vision.uucp
			arpa: mouse at larry.mcrcim.mcgill.edu



More information about the Comp.lang.c mailing list