[net.lang] Pattern Matching macro processor

mwm@ucbvax.ARPA (Mike (I'll be mellow when I'm dead) Meyer) (06/09/85)

Having been nudged about this recently, I've been contemplating writing
a pattern-matching macro processor (ala MORTRAN) for Unix. Before
starting such a beast, I'd like to know if someone already written such
a beast. Replies by mail to ucbvax!mwm preferred.

	Thanx,
	<mike

-- 

	<mike

After 5 years, a quote worthy of Netnews (and it works as disclaimer!):
"Truth is variable."

luscher@nicmad.UUCP (06/13/85)

> 
> Having been nudged about this recently, I've been contemplating writing
> a pattern-matching macro processor (ala MORTRAN) for Unix. Before
> starting such a beast, I'd like to know if someone already written such
> a beast. Replies by mail to ucbvax!mwm preferred.
>
	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.  It is written in FLUB (first language under
bootstrap) which is easily implemented (we did it on a Datacraft, now
Harris, 24 bit machine).  It was written by Waite (?) at U. Colorado
(?).  Good luck in finding it.  You might try the Univ. Wisconsin
as they used to support it on their large machind and had some
documentation available in the Computer Science offices.
 
-- 
Jim Luscher / Nicolet Instruments / Oscilloscope Div.
5225 Verona Rd Bldg-2 / Madison Wi 53711 USA / 608/271-3333x2274

tower@inmet.UUCP (06/14/85)

Re: STAGE2 and FLUB

1) STAGE2 runs over FLUB which runs over SIMCMP (written in Fortran).

2) The text of the whole system is in the appendixes of a booK:
	"Implementing Software for Non-Numeric Applications",
	by William M. Waite, Prentice Hall, Englewood Cliffs, NJ.

3) A letter to Waite c/o the Publisher, might scarce up electronic
   source.

Len Tower
Intermetrics, Inc.

UUCP:     {bellcore,ima,ihnp4}!inmet!tower
INTERNET: ima!inmet!tower@CCA-UNIX.ARPA
USPS:     733 Concord Ave., Cambridge, MA  02138, USA
PHONE:    +1 (617) 661-1840

dww@stl.UUCP (David Wright) (06/18/85)

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..

prl@ethz.UUCP (Peter R. Lamb) (06/24/85)

If the people interested in STAGE2 and FLUB want to contact me
I can give them the (net or post) address of P.C. Poole. However,
I'm not sure if distributions are still available.

Peter Lamb	(...!mcvax!cernvax!ethz!prl)
Institut fur Informatik
ETH Zurich

dww@stl.UUCP (David Wright) (06/27/85)

I still have a file containing the original STAGE2 Distribution System, plus
a few versions of it on long or nearly obsolete machines (ITT 3200, IBM 370,
Intel 8080 under ISIS), though not on UNIX.  The distribution system requires
access to Fortran - tho' once you have this you can re-convert to other
systems/ languages.   However, I do not feel I have the right to distribute
this software to others - it simply is not mine.  Also it is not very useful
without the User Manual, which I do not have in on-line form.   
So - IFF someone has the manual in computer readable form and could send it 
to the net (or me), AND if someone with reasonable (legal?) interest in STAGE2
- e.g. Waite or Poole - were to ask or approve my sending their software to 
you all - I would be willing to post STAGE2 to the net. 
If asked by someone who has established the above.

hugh@hcrvx1.UUCP (Hugh Redelmeier) (07/02/85)

There is another interesting macroprocessor: ML/1.  It was created
about the same time as STAGE2.  At the time (over 10 years ago)
I liked the ML/1 language better.  STAGE2 was perhaps more portable
(although the author of ML/1, P. J. Brown, wrote a book about
portability).  There were two versions of ML/1.  The first was
written in a pigeon ALGOL that could be translated by some ML/1
macros into your favourite assembly language.  The second was
a translation of this into assembly language for a (an?) hypothetical
machine.  One source for this system is DECUS (DEC Users' Society).

In my experience, it is surprising how rarely one ends up using
a macro-processor (I have used UNIX for 10 years; I used m4 this year
for the first time -- to help me build a configurable assembly
language program).