<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
a	O
compiler-compiler	B-Language
or	O
compiler	B-Language
generator	I-Language
is	O
a	O
programming	O
tool	O
that	O
creates	O
a	O
parser	B-Language
,	O
interpreter	B-Application
,	O
or	O
compiler	B-Language
from	O
some	O
form	O
of	O
formal	O
description	O
of	O
a	O
programming	O
language	O
and	O
machine	O
.	O
</s>
<s>
The	O
most	O
common	O
type	O
of	O
compiler-compiler	B-Language
is	O
more	O
precisely	O
called	O
a	O
parser	B-Language
generator	I-Language
.	O
</s>
<s>
It	O
only	O
handles	O
syntactic	B-Language
analysis	I-Language
.	O
</s>
<s>
The	O
input	O
of	O
a	O
parser	B-Language
generator	I-Language
is	O
a	O
grammar	O
file	O
,	O
typically	O
written	O
in	O
Backus	O
–	O
Naur	O
form	O
(	O
BNF	O
)	O
or	O
extended	O
Backus	O
–	O
Naur	O
form	O
(	O
EBNF	O
)	O
that	O
defines	O
the	O
syntax	B-Application
of	O
a	O
target	O
programming	O
language	O
.	O
</s>
<s>
The	O
output	O
is	O
the	O
source	O
code	O
of	O
a	O
parser	B-Language
for	O
the	O
programming	O
language	O
.	O
</s>
<s>
The	O
output	O
of	O
the	O
(	O
compiled	B-Language
)	O
parser	B-Language
source	O
code	O
is	O
a	O
parser	B-Language
.	O
</s>
<s>
This	O
parser	B-Language
takes	O
as	O
an	O
input	O
the	O
source	O
code	O
of	O
the	O
target	O
programming	O
language	O
source	O
and	O
performs	O
some	O
action	O
or	O
outputs	O
an	O
abstract	B-Data_Structure
syntax	I-Data_Structure
tree	I-Data_Structure
(	O
AST	O
)	O
.	O
</s>
<s>
Parser	B-Language
generators	I-Language
do	O
not	O
handle	O
the	O
semantics	B-Application
of	O
the	O
AST	O
,	O
or	O
the	O
generation	B-Application
of	I-Application
machine	I-Application
code	I-Application
for	O
the	O
target	O
machine	O
.	O
</s>
<s>
A	O
metacompiler	B-Language
is	O
a	O
software	O
development	O
tool	O
used	O
mainly	O
in	O
the	O
construction	O
of	O
compilers	B-Language
,	O
translators	B-Application
,	O
and	O
interpreters	B-Application
for	O
other	O
programming	O
languages	O
.	O
</s>
<s>
The	O
input	O
to	O
a	O
metacompiler	B-Language
is	O
a	O
computer	B-Application
program	I-Application
written	O
in	O
a	O
specialized	B-Language
programming	O
metalanguage	O
designed	O
mainly	O
for	O
the	O
purpose	O
of	O
constructing	O
compilers	B-Language
.	O
</s>
<s>
The	O
language	O
of	O
the	O
compiler	B-Language
produced	O
is	O
called	O
the	O
object	O
language	O
.	O
</s>
<s>
The	O
minimal	O
input	O
producing	O
a	O
compiler	B-Language
is	O
a	O
metaprogram	B-Application
specifying	O
the	O
object	O
language	O
grammar	O
and	O
semantic	B-Application
transformations	O
into	O
an	O
object	B-Application
program	I-Application
.	O
</s>
<s>
A	O
typical	O
parser	B-Language
generator	I-Language
associates	O
executable	B-Application
code	I-Application
with	O
each	O
of	O
the	O
rules	O
of	O
the	O
grammar	O
that	O
should	O
be	O
executed	O
when	O
these	O
rules	O
are	O
applied	O
by	O
the	O
parser	B-Language
.	O
</s>
<s>
These	O
pieces	O
of	O
code	O
are	O
sometimes	O
referred	O
to	O
as	O
semantic	B-Language
action	I-Language
routines	I-Language
since	O
they	O
define	O
the	O
semantics	B-Application
of	O
the	O
syntactic	O
structure	O
that	O
is	O
analyzed	O
by	O
the	O
parser	B-Language
.	O
</s>
<s>
Depending	O
upon	O
the	O
type	O
of	O
parser	B-Language
that	O
should	O
be	O
generated	O
,	O
these	O
routines	O
may	O
construct	O
a	O
parse	B-Language
tree	B-Application
(	O
or	O
abstract	B-Data_Structure
syntax	I-Data_Structure
tree	I-Data_Structure
)	O
,	O
or	O
generate	O
executable	B-Application
code	I-Application
directly	O
.	O
</s>
<s>
One	O
of	O
the	O
earliest	O
(	O
1964	O
)	O
,	O
surprisingly	O
powerful	O
,	O
versions	O
of	O
compiler-compilers	B-Language
is	O
META	B-Application
II	I-Application
,	O
which	O
accepted	O
an	O
analytical	O
grammar	O
with	O
output	O
facilities	O
that	B-Application
produce	I-Application
stack	I-Application
machine	I-Application
code	O
,	O
and	O
is	O
able	O
to	O
compile	B-Language
its	O
own	O
source	O
code	O
and	O
other	O
languages	O
.	O
</s>
<s>
Among	O
the	O
earliest	O
programs	O
of	O
the	O
original	O
Unix	B-Application
versions	O
being	O
built	O
at	O
Bell	O
Labs	O
was	O
the	O
two-part	O
lex	B-General_Concept
and	O
yacc	B-Application
system	O
,	O
which	O
was	O
normally	O
used	O
to	O
output	O
C	B-Language
programming	I-Language
language	I-Language
code	O
,	O
but	O
had	O
a	O
flexible	O
output	O
system	O
that	O
could	O
be	O
used	O
for	O
everything	O
from	O
programming	O
languages	O
to	O
text	O
file	O
conversion	O
.	O
</s>
<s>
Their	O
modern	O
GNU	B-Application
versions	O
are	O
flex	B-General_Concept
and	O
bison	B-Application
.	O
</s>
<s>
Some	O
experimental	O
compiler-compilers	B-Language
take	O
as	O
input	O
a	O
formal	O
description	O
of	O
programming	B-Application
language	I-Application
semantics	I-Application
,	O
typically	O
using	O
denotational	B-Application
semantics	I-Application
.	O
</s>
<s>
This	O
approach	O
is	O
often	O
called	O
'	O
semantics-based	O
compiling	B-Language
 '	O
,	O
and	O
was	O
pioneered	O
by	O
Peter	O
Mosses	O
 '	O
Semantic	B-Application
Implementation	O
System	O
(	O
SIS	O
)	O
in	O
1978	O
.	O
</s>
<s>
However	O
,	O
both	O
the	O
generated	O
compiler	B-Language
and	O
the	O
code	O
it	O
produced	O
were	O
inefficient	O
in	O
time	O
and	O
space	O
.	O
</s>
<s>
No	O
production	O
compilers	B-Language
are	O
currently	O
built	O
in	O
this	O
way	O
,	O
but	O
research	O
continues	O
.	O
</s>
<s>
The	O
Production	O
Quality	O
Compiler-Compiler	B-Language
(	O
PQCC	B-Application
)	O
project	O
at	O
Carnegie	O
Mellon	O
University	O
does	O
not	O
formalize	O
semantics	B-Application
,	O
but	O
does	O
have	O
a	O
semi-formal	O
framework	O
for	O
machine	O
description	O
.	O
</s>
<s>
Compiler-compilers	B-Language
exist	O
in	O
many	O
flavors	O
,	O
including	O
bottom-up	O
rewrite	O
machine	O
generators	O
(	O
see	O
)	O
used	O
to	O
tile	O
syntax	B-Application
trees	O
according	O
to	O
a	O
rewrite	O
grammar	O
for	O
code	B-Application
generation	I-Application
,	O
and	O
attribute	B-Application
grammar	I-Application
parser	B-Language
generators	I-Language
(	O
e.g.	O
</s>
<s>
ANTLR	B-Application
can	O
be	O
used	O
for	O
simultaneous	O
type	O
checking	O
,	O
constant	O
propagation	O
,	O
and	O
more	O
during	O
the	O
parsing	B-Language
stage	O
)	O
.	O
</s>
<s>
As	O
a	O
metacompiler	B-Language
's	O
metalanguage	O
will	O
usually	O
be	O
a	O
powerful	O
string	O
and	O
symbol	O
processing	O
language	O
,	O
they	O
often	O
have	O
strong	O
applications	O
for	O
general-purpose	O
applications	O
,	O
including	O
generating	O
a	O
wide	O
range	O
of	O
other	O
software	O
engineering	O
and	O
analysis	O
tools	O
.	O
</s>
<s>
Besides	O
being	O
useful	O
for	O
domain-specific	B-Language
language	I-Language
development	O
,	O
a	O
metacompiler	B-Language
is	O
a	O
prime	O
example	O
of	O
a	O
domain-specific	B-Language
language	I-Language
,	O
designed	O
for	O
the	O
domain	O
of	O
compiler	B-Language
writing	O
.	O
</s>
<s>
A	O
metacompiler	B-Language
is	O
a	O
metaprogram	B-Application
usually	O
written	O
in	O
its	O
own	O
metalanguage	O
or	O
an	O
existing	O
computer	O
programming	O
language	O
.	O
</s>
<s>
The	O
process	O
of	O
a	O
metacompiler	B-Language
,	O
written	O
in	O
its	O
own	O
metalanguage	O
,	O
compiling	B-Language
itself	O
is	O
equivalent	O
to	O
self-hosting	O
compiler	B-Language
.	O
</s>
<s>
Most	O
common	O
compilers	B-Language
written	O
today	O
are	O
self-hosting	O
compilers	B-Language
.	O
</s>
<s>
Self-hosting	O
is	O
a	O
powerful	O
tool	O
,	O
of	O
many	O
metacompilers	B-Language
,	O
allowing	O
the	O
easy	O
extension	O
of	O
their	O
own	O
metaprogramming	B-Application
metalanguage	O
.	O
</s>
<s>
The	O
feature	O
that	O
separates	O
a	O
metacompiler	B-Language
apart	O
from	O
other	O
compiler	B-Language
compilers	I-Language
is	O
that	O
it	O
takes	O
as	O
input	O
a	O
specialized	B-Language
metaprogramming	B-Application
language	O
that	O
describes	O
all	O
aspects	O
of	O
the	O
compiler	B-Language
's	O
operation	O
.	O
</s>
<s>
A	O
metaprogram	B-Application
produced	O
by	O
a	O
metacompiler	B-Language
is	O
as	O
complete	O
a	O
program	B-Application
as	O
a	O
program	B-Application
written	O
in	O
C++	B-Language
,	O
BASIC	O
or	O
any	O
other	O
general	O
programming	O
language	O
.	O
</s>
<s>
The	O
metaprogramming	B-Application
metalanguage	O
is	O
a	O
powerful	O
attribute	O
allowing	O
easier	O
development	O
of	O
computer	O
programming	O
languages	O
and	O
other	O
computer	O
tools	O
.	O
</s>
<s>
Command	O
line	O
processors	O
,	O
text	O
string	O
transforming	O
and	O
analysis	O
are	O
easily	O
coded	O
using	O
metaprogramming	B-Application
metalanguages	O
of	O
metacompilers	B-Language
.	O
</s>
<s>
A	O
full	O
featured	O
development	O
package	O
includes	O
a	O
linker	B-Application
and	O
a	O
run	B-Library
time	I-Library
support	O
library	B-Library
.	O
</s>
<s>
Usually	O
,	O
a	O
machine-oriented	O
system	B-Language
programming	I-Language
language	I-Language
,	O
such	O
as	O
C	B-Language
or	O
C++	B-Language
,	O
is	O
needed	O
to	O
write	O
the	O
support	O
library	B-Library
.	O
</s>
<s>
A	O
library	B-Library
consisting	O
of	O
support	O
functions	O
needed	O
for	O
the	O
compiling	B-Language
process	O
usually	O
completes	O
the	O
full	O
metacompiler	B-Language
package	O
.	O
</s>
<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
the	O
prefix	O
meta	O
is	O
commonly	O
used	O
to	O
mean	O
about	O
(	O
its	O
own	O
category	O
)	O
.	O
</s>
<s>
Backus	O
–	O
Naur	O
form	O
(	O
BNF	O
)	O
is	O
a	O
formal	O
metalanguage	O
originally	O
used	O
to	O
define	O
ALGOL	B-Language
60	I-Language
.	O
</s>
<s>
BNF	O
is	O
a	O
weak	O
metalanguage	O
,	O
for	O
it	O
describes	O
only	O
the	O
syntax	B-Application
and	O
says	O
nothing	O
about	O
the	O
semantics	B-Application
or	O
meaning	O
.	O
</s>
<s>
Metaprogramming	B-Application
is	O
the	O
writing	O
of	O
computer	B-Application
programs	I-Application
with	O
the	O
ability	O
to	O
treat	O
programs	O
as	O
their	O
data	O
.	O
</s>
<s>
A	O
metacompiler	B-Language
takes	O
as	O
input	O
a	O
metaprogram	B-Application
written	O
in	O
a	O
specialized	B-Language
metalanguages	O
(	O
a	O
higher	O
level	O
abstraction	O
)	O
specifically	O
designed	O
for	O
the	O
purpose	O
of	O
metaprogramming	B-Application
.	O
</s>
<s>
The	O
output	O
is	O
an	O
executable	B-Application
object	B-Application
program	I-Application
.	O
</s>
<s>
An	O
analogy	O
can	O
be	O
drawn	O
:	O
That	O
as	O
a	O
C++	B-Language
compiler	B-Language
takes	O
as	O
input	O
a	O
C++	B-Language
programming	I-Language
language	I-Language
program	B-Application
,	O
a	O
metacompiler	B-Language
takes	O
as	O
input	O
a	O
metaprogramming	B-Application
metalanguage	O
program	B-Application
.	O
</s>
<s>
Many	O
advocates	O
of	O
the	O
language	O
Forth	B-Application
call	O
the	O
process	O
of	O
creating	O
a	O
new	O
implementation	O
of	O
Forth	B-Application
a	O
meta-compilation	B-Application
and	O
that	O
it	O
constitutes	O
a	O
metacompiler	B-Language
.	O
</s>
<s>
The	O
Forth	B-Application
definition	O
of	O
metacompiler	B-Language
is	O
:	O
</s>
<s>
"	O
A	O
metacompiler	B-Language
is	O
a	O
compiler	B-Language
which	O
processes	O
its	O
own	O
source	O
code	O
,	O
resulting	O
in	O
an	O
executable	B-Application
version	O
of	O
itself.	O
"	O
</s>
<s>
This	O
Forth	B-Application
use	O
of	O
the	O
term	O
metacompiler	B-Language
is	O
disputed	O
in	O
mainstream	O
computer	B-General_Concept
science	I-General_Concept
.	O
</s>
<s>
See	O
Forth	B-Application
(	O
programming	O
language	O
)	O
and	O
History	B-Application
of	I-Application
compiler	I-Application
construction	I-Application
.	O
</s>
<s>
The	O
actual	O
Forth	B-Application
process	O
of	O
compiling	B-Language
itself	O
is	O
a	O
combination	O
of	O
a	O
Forth	B-Application
being	O
a	O
self-hosting	O
extensible	B-Application
programming	I-Application
language	I-Application
and	O
sometimes	O
cross	O
compilation	B-Language
,	O
long	O
established	O
terminology	O
in	O
computer	B-General_Concept
science	I-General_Concept
.	O
</s>
<s>
Metacompilers	B-Language
are	O
a	O
general	O
compiler	B-Language
writing	O
system	O
.	O
</s>
<s>
Besides	O
the	O
Forth	B-Application
metacompiler	B-Language
concept	O
being	O
indistinguishable	O
from	O
self-hosting	O
and	O
extensible	B-Application
language	I-Application
.	O
</s>
<s>
The	O
actual	O
process	O
acts	O
at	O
a	O
lower	O
level	O
defining	O
a	O
minimum	O
subset	O
of	O
forth	B-Application
words	O
,	O
that	O
can	O
be	O
used	O
to	O
define	O
additional	O
forth	B-Application
words	O
,	O
A	O
full	O
Forth	B-Application
implementation	O
can	O
then	O
be	O
defined	O
from	O
the	O
base	O
set	O
.	O
</s>
<s>
The	O
problem	O
is	O
that	O
almost	O
every	O
general	O
purpose	O
language	B-Language
compiler	I-Language
also	O
fits	O
the	O
Forth	B-Application
metacompiler	B-Language
description	O
.	O
</s>
<s>
When	O
(	O
self-hosting	O
compiler	B-Language
)	O
X	O
processes	O
its	O
own	O
source	O
code	O
,	O
resulting	O
in	O
an	O
executable	B-Application
version	O
of	O
itself	O
,	O
X	O
is	O
a	O
metacompiler	B-Language
.	O
</s>
<s>
Just	O
replace	O
X	O
with	O
any	O
common	O
language	O
,	O
C	B-Language
,	O
C++	B-Language
,	O
Pascal	B-Application
,	O
COBOL	B-Application
,	O
Fortran	B-Application
,	O
Ada	B-Language
,	O
Modula-2	B-Language
,	O
etc	O
.	O
</s>
<s>
And	O
X	O
would	O
be	O
a	O
metacompiler	B-Language
according	O
to	O
the	O
Forth	B-Application
usage	O
of	O
metacompiler	B-Language
.	O
</s>
<s>
A	O
metacompiler	B-Language
operates	O
at	O
an	O
abstraction	O
level	O
above	O
the	O
compiler	B-Language
it	O
compiles	B-Language
.	O
</s>
<s>
It	O
only	O
operates	O
at	O
the	O
same	O
(	O
self-hosting	O
compiler	B-Language
)	O
level	O
when	O
compiling	B-Language
itself	O
.	O
</s>
<s>
One	O
has	O
to	O
see	O
the	O
problem	O
with	O
this	O
definition	O
of	O
metacompiler	B-Language
.	O
</s>
<s>
However	O
,	O
on	O
examining	O
the	O
concept	O
of	O
programming	O
in	O
Forth	B-Application
,	O
adding	O
new	O
words	O
to	O
the	O
dictionary	O
,	O
extending	O
the	O
language	O
in	O
this	O
way	O
is	O
metaprogramming	B-Application
.	O
</s>
<s>
It	O
is	O
this	O
metaprogramming	B-Application
in	O
Forth	B-Application
that	O
makes	O
it	O
a	O
metacompiler	B-Language
.	O
</s>
<s>
Programming	O
in	O
Forth	B-Application
is	O
adding	O
new	O
words	O
to	O
the	O
language	O
.	O
</s>
<s>
Changing	O
the	O
language	O
in	O
this	O
way	O
is	O
metaprogramming	B-Application
.	O
</s>
<s>
Forth	B-Application
is	O
a	O
metacompiler	B-Language
because	O
Forth	B-Application
is	O
a	O
language	O
specifically	O
designed	O
for	O
metaprogramming	B-Application
.	O
</s>
<s>
Programming	O
in	O
Forth	B-Application
is	O
extending	O
Forth	B-Application
adding	O
words	O
to	O
the	O
Forth	B-Application
vocabulary	O
creates	O
a	O
new	O
Forth	B-Application
dialect	O
.	O
</s>
<s>
Forth	B-Application
is	O
a	O
specialized	B-Language
metacompiler	B-Language
for	O
Forth	B-Application
language	I-Application
dialects	O
.	O
</s>
<s>
Design	O
of	O
the	O
original	O
Compiler	B-Language
Compiler	I-Language
was	O
started	O
by	O
Tony	O
Brooker	O
and	O
Derrick	O
Morris	O
in	O
1959	O
,	O
with	O
initial	O
testing	O
beginning	O
in	O
March	O
1962	O
.	O
</s>
<s>
Brooker	O
's	O
Compiler	B-Language
Compiler	I-Language
was	O
used	O
to	O
create	O
compilers	B-Language
for	O
the	O
new	O
Atlas	B-Device
computer	I-Device
at	O
the	O
University	O
of	O
Manchester	O
,	O
for	O
several	O
languages	O
:	O
Mercury	B-Language
Autocode	I-Language
,	O
Extended	O
Mercury	B-Language
Autocode	I-Language
,	O
Atlas	B-Device
Autocode	B-Language
,	O
ALGOL	B-Language
60	I-Language
and	O
ASA	O
Fortran	B-Application
.	O
</s>
<s>
At	O
roughly	O
the	O
same	O
time	O
,	O
related	O
work	O
was	O
being	O
done	O
by	O
E	O
.	O
T	O
.	O
(	O
Ned	O
)	O
Irons	O
at	O
Princeton	O
,	O
and	O
Alick	O
Glennie	O
at	O
the	O
Atomic	O
Weapons	O
Research	O
Establishment	O
at	O
Aldermaston	O
whose	O
"	O
Syntax	B-Application
Machine	O
"	O
paper	O
(	O
declassified	O
in	O
1977	O
)	O
inspired	O
the	O
META	O
series	O
of	O
translator	B-Application
writing	O
systems	O
mentioned	O
below	O
.	O
</s>
<s>
The	O
early	O
history	O
of	O
metacompilers	B-Language
is	O
closely	O
tied	O
with	O
the	O
history	O
of	O
SIG/PLAN	O
Working	O
group	O
1	O
on	O
Syntax	B-Application
Driven	O
Compilers	B-Language
.	O
</s>
<s>
In	O
the	O
fall	O
of	O
1962	O
Howard	O
Metcalfe	O
designed	O
two	O
compiler-writing	O
interpreters	B-Application
.	O
</s>
<s>
Meta	O
I	O
the	O
first	O
metacompiler	B-Language
was	O
implemented	O
by	O
Schorre	O
on	O
an	O
IBM	O
1401	O
at	O
UCLA	O
in	O
January	O
1963	O
.	O
</s>
<s>
His	O
original	O
interpreters	B-Application
and	O
metamachines	O
were	O
written	O
directly	O
in	O
a	O
pseudo-machine	O
language	O
.	O
</s>
<s>
META	B-Application
II	I-Application
,	O
however	O
,	O
was	O
written	O
in	O
a	O
higher-level	O
metalanguage	O
able	O
to	O
describe	O
its	O
own	O
compilation	B-Language
into	O
the	O
pseudo-machine	O
language	O
.	O
</s>
<s>
Lee	O
Schmidt	O
at	O
Bolt	O
,	O
Beranek	O
,	O
and	O
Newman	O
wrote	O
a	O
metacompiler	B-Language
in	O
March	O
1963	O
that	O
utilized	O
a	O
CRT	O
display	O
on	O
the	O
time-sharing	O
PDP-l	O
.	O
</s>
<s>
This	O
compiler	B-Language
produced	O
actual	O
machine	O
code	O
rather	O
than	O
interpretive	O
code	O
and	O
was	O
partially	O
bootstrapped	O
from	O
Meta	O
I	O
.	O
</s>
<s>
Schorre	O
bootstrapped	O
Meta	B-Application
II	I-Application
from	O
Meta	O
I	O
during	O
the	O
Spring	O
of	O
1963	O
.	O
</s>
<s>
The	O
paper	O
on	O
the	O
refined	O
metacompiler	B-Language
system	O
presented	O
at	O
the	O
1964	O
Philadelphia	O
ACM	O
conference	O
is	O
the	O
first	O
paper	O
on	O
a	O
metacompiler	B-Language
available	O
as	O
a	O
general	O
reference	O
.	O
</s>
<s>
The	O
syntax	B-Application
and	O
implementation	O
technique	O
of	O
Schorre	O
's	O
system	O
laid	O
the	O
foundation	O
for	O
most	O
of	O
the	O
systems	O
that	O
followed	O
.	O
</s>
<s>
The	O
system	O
was	O
implemented	O
on	O
a	O
small	O
1401	O
,	O
and	O
was	O
used	O
to	O
implement	O
a	O
small	O
ALGOL-like	B-Language
language	O
.	O
</s>
<s>
This	O
compiler	B-Language
used	O
an	O
algorithm	O
that	O
produced	O
efficient	O
code	O
for	O
Boolean	O
expressions	O
.	O
</s>
<s>
Two	O
compilers	B-Language
were	O
written	O
in	O
Meta	O
III	O
,	O
CODOL	O
,	O
a	O
compiler-writing	O
demonstration	O
compiler	B-Language
,	O
and	O
PUREGOL	O
,	O
a	O
dialect	O
of	O
ALGOL	B-Language
60	I-Language
.	O
</s>
<s>
(	O
It	O
was	O
pure	O
gall	O
to	O
call	O
it	O
ALGOL	B-Language
)	O
.	O
</s>
<s>
Late	O
in	O
1964	O
,	O
Lee	O
Schmidt	O
bootstrapped	O
the	O
metacompiler	B-Language
EQGEN	O
,	O
from	O
the	O
PDP-l	O
to	O
the	O
Beckman	O
420	O
.	O
</s>
<s>
In	O
1964	O
,	O
System	O
Development	O
Corporation	O
began	O
a	O
major	O
effort	O
in	O
the	O
development	O
of	O
metacompilers	B-Language
.	O
</s>
<s>
This	O
effort	O
includes	O
powerful	O
metacompilers	B-Language
,	O
Bookl	O
,	O
and	O
Book2	O
written	O
in	O
Lisp	B-Language
which	O
have	O
extensive	O
tree-searching	O
and	O
backup	O
ability	O
.	O
</s>
<s>
An	O
outgrowth	O
of	O
one	O
of	O
the	O
Q-32	B-Architecture
systems	O
at	O
SDC	O
is	O
Meta	O
5	O
.	O
</s>
<s>
The	O
Meta	O
5	O
system	O
incorporates	O
backup	O
of	O
the	O
input	O
stream	O
and	O
enough	O
other	O
facilities	O
to	O
parse	B-Language
any	O
context-sensitive	O
language	O
.	O
</s>
<s>
This	O
system	O
was	O
successfully	O
released	O
to	O
a	O
wide	O
number	O
of	O
users	O
and	O
had	O
many	O
string-manipulation	O
applications	O
other	O
than	O
compiling	B-Language
.	O
</s>
<s>
That	O
Meta	O
5	O
successfully	O
translates	O
JOVIAL	B-Language
programs	O
to	O
PL/I	B-Language
programs	O
demonstrates	O
its	O
power	O
and	O
flexibility	O
.	O
</s>
<s>
Robert	O
McClure	O
at	O
Texas	O
Instruments	O
invented	O
a	O
compiler-compiler	B-Language
called	O
TMG	B-Application
(	O
presented	O
in	O
1965	O
)	O
.	O
</s>
<s>
TMG	B-Application
was	O
used	O
to	O
create	O
early	O
compilers	B-Language
for	O
programming	O
languages	O
like	O
B	B-Language
,	O
PL/I	B-Language
and	O
ALTRAN	B-Language
.	O
</s>
<s>
Together	O
with	O
metacompiler	B-Language
of	O
Val	O
Schorre	O
,	O
it	O
was	O
an	O
early	O
inspiration	O
for	O
the	O
last	O
chapter	O
of	O
Donald	O
Knuth	O
's	O
The	B-General_Concept
Art	I-General_Concept
of	I-General_Concept
Computer	I-General_Concept
Programming	I-General_Concept
.	O
</s>
<s>
The	O
LOT	O
system	O
was	O
developed	O
during	O
1966	O
at	O
Stanford	O
Research	O
Institute	O
and	O
was	O
modeled	O
very	O
closely	O
after	O
Meta	B-Application
II	I-Application
.	O
</s>
<s>
It	O
had	O
new	O
special-purpose	O
constructs	O
allowing	O
it	O
to	O
generate	O
a	O
compiler	B-Language
which	O
could	O
in	O
turn	O
,	O
compile	B-Language
a	O
subset	O
of	O
PL/I	B-Language
.	O
</s>
<s>
SIMPLE	O
is	O
a	O
specialized	B-Language
translator	B-Application
system	O
designed	O
to	O
aid	O
the	O
writing	O
of	O
pre-processors	O
for	O
PL/I	B-Language
,	O
SIMPLE	O
,	O
written	O
in	O
PL/I	B-Language
,	O
is	O
composed	O
of	O
three	O
components	O
:	O
An	O
executive	O
,	O
a	O
syntax	B-Application
analyzer	O
and	O
a	O
semantic	B-Application
constructor	O
.	O
</s>
<s>
The	O
TREE-META	B-Application
compiler	B-Language
was	O
developed	O
at	O
Stanford	O
Research	O
Institute	O
in	O
Menlo	O
Park	O
,	O
California	O
.	O
</s>
<s>
The	O
early	O
metacompiler	B-Language
history	O
is	O
well	O
documented	O
in	O
the	O
TREE	B-Application
META	I-Application
paralleled	O
some	O
of	O
the	O
SDC	O
developments	O
.	O
</s>
<s>
Unlike	O
earlier	O
metacompilers	B-Language
it	O
separated	O
the	O
semantics	B-Application
processing	O
from	O
the	O
syntax	B-Application
processing	O
.	O
</s>
<s>
The	O
syntax	B-Application
rules	O
contained	O
tree	B-Application
building	O
operations	O
that	O
combined	O
recognized	O
language	O
elements	O
with	O
tree	B-Application
nodes	O
.	O
</s>
<s>
The	O
tree	B-Application
structure	O
representation	O
of	O
the	O
input	O
was	O
then	O
processed	O
by	O
a	O
simple	O
form	O
of	O
unparse	O
rules	O
.	O
</s>
<s>
In	O
addition	O
like	O
tree	B-Application
element	O
could	O
also	O
be	O
tested	O
in	O
an	O
unparse	O
rule	O
.	O
</s>
<s>
Unparse	O
rules	O
were	O
also	O
a	O
recursive	O
language	O
being	O
able	O
to	O
call	O
unparse	O
rules	O
passing	O
elements	O
of	O
thee	O
tree	B-Application
before	O
the	O
action	O
of	O
the	O
unparse	O
rule	O
was	O
performed	O
.	O
</s>
<s>
The	O
concept	O
of	O
the	O
metamachine	O
originally	O
put	O
forth	B-Application
by	O
Glennie	O
is	O
so	O
simple	O
that	O
three	O
hardware	O
versions	O
have	O
been	O
designed	O
and	O
one	O
actually	O
implemented	O
.	O
</s>
<s>
CWIC	O
(	O
Compiler	B-Language
for	O
Writing	O
and	O
Implementing	O
Compilers	B-Language
)	O
is	O
the	O
last	O
known	O
Schorre	O
metacompiler	B-Language
.	O
</s>
<s>
It	O
was	O
developed	O
at	O
Systems	O
Development	O
Corporation	O
by	O
Erwin	O
Book	O
,	O
Dewey	O
Val	O
Schorre	O
and	O
Steven	O
J	O
.	O
Sherman	O
With	O
the	O
full	O
power	O
of	O
(	O
lisp	B-Language
2	I-Language
)	O
a	O
list	B-Language
processing	I-Language
language	I-Language
optimizing	O
algorithms	O
could	O
operate	O
on	O
syntax	B-Application
generated	O
lists	O
and	O
trees	O
before	O
code	B-Application
generation	I-Application
.	O
</s>
<s>
With	O
the	O
resurgence	O
of	O
domain-specific	B-Language
languages	I-Language
and	O
the	O
need	O
for	O
parser	B-Language
generators	I-Language
which	O
are	O
easy	O
to	O
use	O
,	O
easy	O
to	O
understand	O
,	O
and	O
easy	O
to	O
maintain	O
,	O
metacompilers	B-Language
are	O
becoming	O
a	O
valuable	O
tool	O
for	O
advanced	O
software	O
engineering	O
projects	O
.	O
</s>
<s>
Other	O
examples	O
of	O
parser	B-Language
generators	I-Language
in	O
the	O
yacc	B-Application
vein	O
are	O
ANTLR	B-Application
,	O
Coco/R	B-Application
,	O
CUP	O
,	O
GNU	B-Application
Bison	I-Application
,	O
Eli	O
,	O
FSL	O
,	O
SableCC	B-Language
,	O
SID	O
(	O
Syntax	B-Application
Improving	O
Device	O
)	O
,	O
and	O
JavaCC	B-Language
.	O
</s>
<s>
While	O
useful	O
,	O
pure	O
parser	B-Language
generators	I-Language
only	O
address	O
the	O
parsing	B-Language
part	O
of	O
the	O
problem	O
of	O
building	O
a	O
compiler	B-Language
.	O
</s>
<s>
Tools	O
with	O
broader	O
scope	O
,	O
such	O
as	O
PQCC	B-Application
,	O
Coco/R	B-Application
and	O
DMS	B-Application
Software	I-Application
Reengineering	I-Application
Toolkit	I-Application
provide	O
considerable	O
support	O
for	O
more	O
difficult	O
post-parsing	O
activities	O
such	O
as	O
semantic	B-Application
analysis	O
,	O
code	O
optimization	O
and	O
generation	O
.	O
</s>
<s>
The	O
earliest	O
Schorre	O
metacompilers	B-Language
,	O
META	O
I	O
and	O
META	B-Application
II	I-Application
,	O
were	O
developed	O
by	O
D	O
.	O
Val	O
Schorre	O
at	O
UCLA	O
.	O
</s>
<s>
Other	O
Schorre	O
based	O
metacompilers	B-Language
followed	O
.	O
</s>
<s>
Each	O
adding	O
improvements	O
to	O
language	O
analysis	O
and/or	O
code	B-Application
generation	I-Application
.	O
</s>
<s>
In	O
programming	O
it	O
is	O
common	O
to	O
use	O
the	O
programming	O
language	O
name	O
to	O
refer	O
to	O
both	O
the	O
compiler	B-Language
and	O
the	O
programming	O
language	O
,	O
the	O
context	O
distinguishing	O
the	O
meaning	O
.	O
</s>
<s>
A	O
C++	B-Language
program	I-Language
is	O
compiled	B-Language
using	O
a	O
C++	B-Language
compiler	B-Language
.	O
</s>
<s>
For	O
example	O
,	O
META	B-Application
II	I-Application
is	O
both	O
the	O
compiler	B-Language
and	O
the	O
language	O
.	O
</s>
<s>
The	O
metalanguages	O
in	O
the	O
Schorre	O
line	O
of	O
metacompilers	B-Language
are	O
functional	O
programming	O
languages	O
that	O
use	O
top	O
down	O
grammar	O
analyzing	O
syntax	B-Application
equations	O
having	O
embedded	O
output	O
transformation	O
constructs	O
.	O
</s>
<s>
A	O
syntax	B-Application
equation	O
:	O
</s>
<s>
is	O
a	O
compiled	B-Language
test	O
function	O
returning	O
success	O
or	O
failure	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
program	B-Application
could	O
be	O
defined	O
as	O
:	O
</s>
<s>
Defining	O
a	O
program	B-Application
as	O
a	O
sequence	O
of	O
zero	O
or	O
more	O
declaration(s )	O
.	O
</s>
<s>
The	O
program	B-Application
rule	O
above	O
is	O
an	O
example	O
of	O
a	O
driving	O
rule	O
.	O
</s>
<s>
The	O
program	B-Application
rule	O
is	O
a	O
test	O
function	O
that	O
calls	O
declaration	O
,	O
a	O
test	O
rule	O
,	O
that	O
returns	O
success	O
or	O
failure	O
.	O
</s>
<s>
Above	O
program	B-Application
would	O
always	O
return	O
success	O
.	O
</s>
<s>
The	O
character	O
sets	O
of	O
these	O
early	O
compilers	B-Language
were	O
limited	O
.	O
</s>
<s>
"	O
A	O
or	O
B	B-Language
"	O
is	O
written	O
as	O
A	O
/	O
B	B-Language
.	O
Parentheses	O
(	O
)	O
are	O
used	O
for	O
grouping	O
.	O
</s>
<s>
Indicates	O
that	O
X	O
is	O
optionally	O
followed	O
by	O
A	O
or	O
B	B-Language
.	O
</s>
<s>
Other	O
compiler	B-Language
constructor	O
systems	O
may	O
have	O
declared	O
the	O
three	O
possible	O
sequences	O
and	O
left	O
it	O
up	O
to	O
the	O
parser	B-Language
to	O
figure	O
it	O
out	O
.	O
</s>
<s>
The	O
characteristics	O
of	O
the	O
metaprogramming	B-Application
metalanguages	O
above	O
are	O
common	O
to	O
all	O
Schorre	O
metacompilers	B-Language
and	O
those	O
derived	O
from	O
them	O
.	O
</s>
<s>
META	O
I	O
was	O
a	O
hand	O
compiled	B-Language
metacompiler	B-Language
used	O
to	O
compile	B-Language
META	B-Application
II	I-Application
.	O
</s>
<s>
Little	O
else	O
is	O
known	O
of	O
META	O
I	O
except	O
that	O
the	O
initial	O
compilation	B-Language
of	O
META	B-Application
II	I-Application
produced	O
nearly	O
identical	O
code	O
to	O
that	O
of	O
the	O
hand	O
coded	O
META	O
I	O
compiler	B-Language
.	O
</s>
<s>
A	O
rule	O
attempts	O
to	O
match	O
some	O
part	O
of	O
the	O
input	O
program	B-Application
source	O
character	O
stream	O
returning	O
success	O
or	O
failure	O
.	O
</s>
<s>
Output	O
productions	O
produced	O
a	O
form	O
of	O
assembly	O
code	O
directly	O
from	O
a	O
syntax	B-Application
rule	O
.	O
</s>
<s>
TREE-META	B-Application
introduced	O
tree	B-Application
building	O
operators	O
:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1	O
]	O
moving	O
the	O
output	O
production	O
transforms	O
to	O
unparsed	O
rules	O
.	O
</s>
<s>
The	O
tree	B-Application
building	O
operators	O
were	O
used	O
in	O
the	O
grammar	O
rules	O
directly	O
transforming	O
the	O
input	O
into	O
an	O
abstract	B-Data_Structure
syntax	I-Data_Structure
tree	I-Data_Structure
.	O
</s>
<s>
Unparse	O
rules	O
are	O
also	O
test	O
functions	O
that	O
matched	O
tree	B-Application
patterns	O
.	O
</s>
<s>
Unparse	O
rules	O
are	O
called	O
from	O
a	O
grammar	O
rule	O
when	O
an	O
abstract	B-Data_Structure
syntax	I-Data_Structure
tree	I-Data_Structure
is	O
to	O
be	O
transformed	O
into	O
output	O
code	O
.	O
</s>
<s>
The	O
building	O
of	O
an	O
abstract	B-Data_Structure
syntax	I-Data_Structure
tree	I-Data_Structure
and	O
unparse	O
rules	O
allowed	O
local	O
optimizations	O
to	O
be	O
performed	O
by	O
analyzing	O
the	O
parse	B-Language
tree	B-Application
.	O
</s>
<s>
(	O
Compiler	B-Language
for	O
Writing	O
and	O
Implementing	O
Compilers	B-Language
)	O
at	O
System	O
Development	O
Corporation	O
,	O
</s>
<s>
CWIC	O
is	O
a	O
compiler	B-Language
development	O
system	O
composed	O
of	O
three	O
special-purpose	O
,	O
domain	O
specific	O
,	O
languages	O
,	O
each	O
intended	O
to	O
permit	O
the	O
description	O
of	O
certain	O
aspects	O
of	O
translation	O
in	O
a	O
straight	O
forward	O
manner	O
.	O
</s>
<s>
The	O
syntax	B-Application
language	O
is	O
used	O
to	O
describe	O
the	O
recognition	O
of	O
source	O
text	O
and	O
the	O
construction	O
from	O
it	O
to	O
an	O
intermediate	O
tree	B-Application
structure	O
.	O
</s>
<s>
The	O
generator	O
language	O
is	O
used	O
to	O
describe	O
the	O
transformation	O
of	O
the	O
tree	B-Application
into	O
appropriate	O
object	O
language	O
.	O
</s>
<s>
The	O
syntax	B-Application
language	O
follows	O
Dewey	O
Val	O
Schorre	O
's	O
previous	O
line	O
of	O
metacompilers	B-Language
.	O
</s>
<s>
It	O
most	O
resembles	O
TREE-META	B-Application
having	O
tree	B-Application
building	O
operators	O
in	O
the	O
syntax	B-Application
language	O
.	O
</s>
<s>
The	O
unparse	O
rules	O
of	O
TREE-META	B-Application
are	O
extended	O
to	O
work	O
with	O
the	O
object	O
based	O
generator	O
language	O
based	O
on	O
LISP	B-Language
2	I-Language
.	O
</s>
<s>
Syntax	B-Application
:	O
Transforms	O
the	O
source	O
program	B-Application
input	O
,	O
into	O
list	O
structures	O
using	O
grammar	O
transformation	O
formula	O
.	O
</s>
<s>
A	O
parsed	B-Language
expression	O
structure	O
is	O
passed	O
to	O
a	O
generator	O
by	O
placement	O
of	O
a	O
generator	O
call	O
in	O
a	O
rule	O
.	O
</s>
<s>
A	O
tree	B-Application
is	O
represented	O
by	O
a	O
list	O
whose	O
first	O
element	O
is	O
a	O
node	O
object	O
.	O
</s>
<s>
operator	O
combines	O
a	O
number	O
of	O
parsed	B-Language
entries	O
with	O
a	O
node	O
to	O
make	O
a	O
tree	B-Application
.	O
</s>
<s>
Trees	O
created	O
by	O
syntax	B-Application
rules	O
are	O
passed	O
to	O
generator	O
functions	O
,	O
returning	O
success	O
or	O
failure	O
.	O
</s>
<s>
The	O
syntax	B-Application
language	O
is	O
very	O
close	O
to	O
TREE-META	B-Application
.	O
</s>
<s>
CWIC	O
's	O
tree	B-Application
building	O
exclamation	O
!	O
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1 ]	O
.	O
</s>
<s>
and	O
an	O
output	O
production	O
written	O
in	O
a	O
LISP	B-Language
2	I-Language
like	O
language	O
.	O
</s>
<s>
MOL-360	B-Language
:	O
an	O
independent	O
mid	B-Language
level	I-Language
implementation	I-Language
language	I-Language
for	O
the	O
IBM	O
System/360	O
family	O
of	O
computers	O
developed	O
in	O
1968	O
and	O
used	O
for	O
writing	O
the	O
underlying	O
support	O
library	B-Library
.	O
</s>
<s>
Generators	O
Language	O
had	O
semantics	B-Application
similar	O
to	O
Lisp	B-Language
.	O
</s>
<s>
The	O
parse	B-Language
tree	B-Application
was	O
thought	O
of	O
as	O
a	O
recursive	O
list	O
.	O
</s>
<s>
The	O
code	O
to	O
process	O
a	O
given	O
tree	B-Application
included	O
the	O
features	O
of	O
a	O
general	O
purpose	O
programming	O
language	O
,	O
plus	O
a	O
form	O
:	O
stuff	O
,	O
which	O
would	O
emit	O
(	O
stuff	O
)	O
onto	O
the	O
output	O
file	O
.	O
</s>
<s>
That	O
is	O
,	O
if	O
the	O
parse	B-Language
tree	B-Application
looks	O
like	O
(	O
ADD[ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1	O
and	O
return	O
x	O
.	O
</s>
<s>
"	O
A	O
metacompiler	B-Language
assists	O
the	O
task	O
of	O
compiler-building	O
by	O
automating	O
its	O
non	O
creative	O
aspects	O
,	O
those	O
aspects	O
that	O
are	O
the	O
same	O
regardless	O
of	O
the	O
language	O
which	O
the	O
produced	O
compiler	B-Language
is	O
to	O
translate	O
.	O
</s>
<s>
parboiled	B-Language
,	O
a	O
Java	O
library	B-Library
for	O
building	O
parsers	B-Language
.	O
</s>
<s>
PackCC	B-Application
,	O
a	O
packrat	B-Application
parser	I-Application
with	O
left	B-Application
recursion	I-Application
support	O
.	O
</s>
<s>
PQCC	B-Application
,	O
a	O
compiler-compiler	B-Language
that	O
is	O
more	O
than	O
a	O
parser	B-Language
generator	I-Language
.	O
</s>
<s>
SYNTAX	B-Application
,	O
an	O
integrated	O
toolset	O
for	O
compiler	B-Language
construction	O
.	O
</s>
