Path: utzoo!yunexus!geac!daveb From: daveb@geac.UUCP (David Collier-Brown) Newsgroups: comp.software-eng Subject: Re: Soft-Eng Digest v5n13 Summary: Sidebar on Deterministic Finite Automaton compilers. Message-ID: <2859@geac.UUCP> Date: 13 Jun 88 12:35:31 GMT Article-I.D.: geac.2859 References: <8806082028.AA14514@pcsc-sun.mitre.org> <5444@pucc.Princeton.EDU> Reply-To: daveb@geac.UUCP (David Collier-Brown) Organization: The Geac "Its Tough To Be Green" Department Lines: 106 | In article <8806082028.AA14514@pcsc-sun.mitre.org>, nigam@pcsc-sun (Alok Nigam) writes: | (6) I am currently modifying some code based on an undocumented and | erroneous Finite State Machine -- ARRRGH In article <5444@pucc.Princeton.EDU> EGNILGES@pucc.Princeton.EDU writes: | You have my sympathy, but if you replace the string "Finite State | Machine", the "ARRRGH" is still valid! For mere humans, there is a good FSA compiler in the Kermit distribution, called "wart". Use of it makes 1) the notation a fair bit easier to follow, and 2) the ugly generated/required code irrelevant. I have an upgraded version, available by mail for anyone with a C compiler. Please note that Wart does not have to genrate C: FORTRAN II would probably be ok. You need a C compiler to compile Wart itself. A short description follows: WART(1) NAME wart -- a dfa compiler SYNOPSIS wart [file] DESCRIPTION Wart is a program which takes a yacc-like file of code and directives and generates a c program from it. The directives define a deterministic finite automaton (DFA), and are primarily for producing protocol engines, such as are used by C-Kermit. The format of the file is: lines to be copied %states %events %% event { block of code to be executed } ... event { block of code to be executed } event { more code... } ... %% more lines to be copied Wart therefor implements a small subset of the Unix 'lex' lexical analyzer generator. Unlike lex, wart may be distributed without requirement for a Unix license. Wart is intended for production of state table switch- ers. It allows a set of states to be defined, along with a function for getting input, and a table of state transi- tions. A C program is generated which performs actions and switches states based on the current state and the input. [...] HISTORY Wart was written by Jeff Damens of the Columbia Center for Computing Activities, November, 1985, to facilitate development of Unix Kermit. It was updated by David Brown of Tesseract Technologies in February, 1986. The program is Copyright (C) 1985, the Trustees of Columbia University in the City of New York. The earlier version assumed that the event would be a single ascii character, and did not support the "%events" directive. 5 -- David Collier-Brown. {mnetor yunexus utgpu}!geac!daveb Geac Computers Ltd., | "His Majesty made you a major 350 Steelcase Road, | because he believed you would Markham, Ontario. | know when not to obey his orders"