Re: pattern languages

liberte@m.cs.uiuc.edu (Daniel LaLiberte)
Wed, 9 Nov 88 22:15:18 CST

          From comp.compilers

Related articles
Pattern languages uiucdcs!uunet!mcvax!cui!oscar (1988-11-04)
Re: Pattern languages steve@hubcap.UUCP (1988-11-07)
Re: Pattern languages ti-csl!tilde.ti.com!Gateley@cs.utexas.edu (John Gateley) (1988-11-15)
Re: pattern languages liberte@m.cs.uiuc.edu (1988-11-09)
Re: Pattern Languages cordy@QUCIS.BITNET (1988-11-15)
Re: Pattern languages harvard!ucbvax.Berkeley.EDU!decvax!tl-vaxa!grover (1988-11-14)
| List of all articles for this month |
Date: Wed, 9 Nov 88 22:15:18 CST
From: liberte@m.cs.uiuc.edu (Daniel LaLiberte)

I copied an article out of the SIGPLAN Notices, August 1969 which may have
been a conference procedings. The article "Transformations: The
Extension Facility of Proteus" by James Bell at DEC describes a language
in which you specify the form of an expression and what it is transformed
into using named arguments. Then the names are used in expressions
which describe what to do at compile time and what to do at run time.


Here is an example of defining complex addition. First, the pattern
of a complex literal (or type?) is given.


pattern complex ! complex <- "<REAL:int> + <IMAG:int> I" !


Now complex addition is defined in terms of the complex pattern.


trans 30 "<X:complex> + <Y:complex>" <- "<Z:complex>" !
Z.REAL <- X.REAL + Y.REAL,
Z.IMAG <- x.IMAG + Y.IMAG:


The "30" is a priority. So if the compiler sees "X + Y" where X and
Y are complex, "Z" is substituted where the REAL and IMAG parts of
Z are as specified.




Dan LaLiberte
uiucdcs!liberte
liberte@cs.uiuc.edu
liberte%a.cs.uiuc.edu@uiucvmd.bitnet
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.