Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site stl.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!mcvax!ukc!stc!stl!dww From: dww@stl.UUCP (David Wright) Newsgroups: net.lang,net.wanted,net.usoft Subject: Re: Pattern Matching macro processor Message-ID: <179@stl.UUCP> Date: Tue, 18-Jun-85 04:17:15 EDT Article-I.D.: stl.179 Posted: Tue Jun 18 04:17:15 1985 Date-Received: Thu, 20-Jun-85 10:53:09 EDT References: <7981@ucbvax.ARPA> <209@nicmad.UUCP> Reply-To: dww@stl.UUCP (David Wright) Organization: STL,Harlow,UK. Lines: 43 Xref: watmath net.lang:1618 net.wanted:6588 net.usoft:96 Xpath: stc stc-a In article <209@nicmad.UUCP> luscher@nicmad.UUCP writes: >> >> Having been nudged about this recently, I've been contemplating writing >> a pattern-matching macro processor (ala MORTRAN) for Unix. Before ... > It has been a while since I've used it, but an interesting, >"machine independent", standalone 'template' (I found this style of >pattern matching very interesting) pattern matching macro processor >exists called STAGE2. >-- >Jim Luscher / Nicolet Instruments / Oscilloscope Div. See "The STAGE2 Macroprocessor User Reference Manual", P.C.Poole, W.M.Waite, UK Atomic Energy Authority Research Group publication CLM-PDN 6/70 Culham Laboratory Abindon Berkshire UK Publication date 1970. Yes that makes it pretty old, but then so is UNIX. W.M. Poole is shown as "Dept of Electrical Engineering, University of Colorado" so maybe they still supply the distribution tape. An aditional European source back in 1972 was the Dept of Electrical Engineering Science at the University of Essex (Colchester England). I used to use STAGE2 a few years ago when I was doing some crude compiler work. It wasn't really up to it, because my language was free-format whereas STAGE2 is easiest to use on input grammars where line endings are significant - but for something less than a compiler-sized task that was not hard to get round. STAGE2 is good for translating one set of patterns into another - indeed that's all it does, but then that's all compilers do really! Probably a good use would be for translating between different but not totally alien computer languages, esp. if a human-edit to tidy up semantic differences is acceptable. I once did a sort of AI-ish program that built up definitions of English words in STAGE2 so it's pretty flexible. I have also implemented it on various machines (eg IBM360 and Intel 8080 - well it was a long time ago) and languages. The standard distribution tape version is in Fortran, once you have this up you can use STAGE2 to re-translate itself into assembler, PL/M, C, etc..