<s>
XPL	B-Language
is	O
a	O
programming	O
language	O
based	O
on	O
PL/I	B-Language
,	O
a	O
portable	O
one-pass	B-Language
compiler	I-Language
written	O
in	O
its	O
own	O
language	O
,	O
and	O
a	O
parser	B-Language
generator	I-Language
tool	O
for	O
easily	O
implementing	O
similar	O
compilers	O
for	O
other	O
languages	O
.	O
</s>
<s>
XPL	B-Language
was	O
designed	O
in	O
1967	O
as	O
a	O
way	O
to	O
teach	O
compiler	O
design	O
principles	O
and	O
as	O
starting	O
point	O
for	O
students	O
to	O
build	O
compilers	O
for	O
their	O
own	O
languages	O
.	O
</s>
<s>
XPL	B-Language
was	O
designed	O
and	O
implemented	O
by	O
William	O
M	O
.	O
McKeeman	O
,	O
David	O
B	O
.	O
Wortman	O
,	O
James	O
J	O
.	O
Horning	O
and	O
others	O
at	O
Stanford	O
University	O
.	O
</s>
<s>
XPL	B-Language
was	O
first	O
announced	O
at	O
the	O
1968	O
Fall	O
Joint	O
Computer	O
Conference	O
.	O
</s>
<s>
The	O
methods	O
and	O
compiler	O
are	O
described	O
in	O
detail	O
in	O
the	O
1971	O
textbook	O
A	O
Compiler	B-Language
Generator	I-Language
.	O
</s>
<s>
They	O
called	O
the	O
combined	O
work	O
a	O
'	O
compiler	B-Language
generator	I-Language
 '	O
.	O
</s>
<s>
A	O
better	O
label	O
for	O
XPL	B-Language
is	O
a	O
translator	B-Application
writing	O
system	O
.	O
</s>
<s>
The	O
XPL	B-Language
language	O
is	O
a	O
simple	O
,	O
small	O
,	O
efficient	O
dialect	O
of	O
PL/I	B-Language
intended	O
mainly	O
for	O
the	O
task	O
of	O
writing	O
compilers	O
.	O
</s>
<s>
The	O
XPL	B-Language
language	O
was	O
also	O
used	O
for	O
other	O
purposes	O
once	O
it	O
was	O
available	O
.	O
</s>
<s>
XPL	B-Language
can	O
be	O
compiled	O
easily	O
to	O
most	O
modern	O
machines	O
by	O
a	O
simple	O
compiler	O
.	O
</s>
<s>
Compiler	O
internals	O
can	O
be	O
written	O
easily	O
in	O
XPL	B-Language
,	O
and	O
the	O
code	O
is	O
easy	O
to	O
read	O
.	O
</s>
<s>
The	O
PL/I	B-Language
language	O
was	O
designed	O
by	O
an	O
IBM	O
committee	O
in	O
1964	O
as	O
a	O
comprehensive	O
language	O
replacing	O
Fortran	B-Application
,	O
COBOL	B-Application
,	O
and	O
ALGOL	B-Language
,	O
and	O
meeting	O
all	O
customer	O
and	O
internal	O
needs	O
.	O
</s>
<s>
These	O
ambitious	O
goals	O
made	O
PL/I	B-Language
complex	O
,	O
hard	O
to	O
implement	O
efficiently	O
,	O
and	O
sometimes	O
surprising	O
when	O
used	O
.	O
</s>
<s>
XPL	B-Language
is	O
a	O
small	O
dialect	O
of	O
the	O
full	O
language	O
.	O
</s>
<s>
XPL	B-Language
has	O
one	O
added	O
feature	O
not	O
found	O
in	O
PL/I	B-Language
:	O
a	O
STRING	O
datatype	O
with	O
dynamic	O
lengths	O
.	O
</s>
<s>
String	O
values	O
live	O
in	O
a	O
separate	O
text-only	O
heap	B-Application
memory	O
space	O
with	O
automatic	B-General_Concept
garbage	I-General_Concept
collection	I-General_Concept
of	O
stale	O
values	O
.	O
</s>
<s>
Much	O
of	O
what	O
a	O
simple	O
compiler	O
does	O
is	O
manipulating	O
input	O
text	O
and	O
output	O
byte	O
streams	O
,	O
so	O
this	O
feature	O
helps	O
simplify	O
XPL-based	O
compilers	O
.	O
</s>
<s>
The	O
XPL	B-Language
compiler	O
,	O
called	O
XCOM	O
,	O
is	O
a	O
one-pass	B-Language
compiler	I-Language
using	O
a	O
table-driven	O
parser	B-Language
and	O
simple	O
code	B-Application
generation	I-Application
techniques	O
.	O
</s>
<s>
Versions	O
of	O
XCOM	O
exist	O
for	O
different	O
machine	B-General_Concept
architectures	I-General_Concept
,	O
using	O
different	O
hand-written	O
code	B-Application
generation	I-Application
modules	O
for	O
those	O
targets	O
.	O
</s>
<s>
The	O
original	O
target	O
was	O
IBM	B-Application
System/360	I-Application
,	O
which	O
is	O
a	O
proper	O
subset	O
of	O
IBM	B-Device
System/370	I-Device
,	O
IBM	B-Device
System/390	I-Device
and	O
IBM	B-Device
System	I-Device
z	I-Device
.	O
</s>
<s>
XCOM	O
compiles	O
from	O
XPL	B-Language
source	O
code	O
,	O
but	O
since	O
XCOM	O
itself	O
is	O
written	O
in	O
XPL	B-Language
it	O
can	O
compile	O
itself	O
–	O
it	O
is	O
a	O
self-compiling	O
compiler	O
,	O
not	O
reliant	O
on	O
other	O
compilers	O
.	O
</s>
<s>
Several	O
famous	O
languages	O
have	O
self-compiling	O
compilers	O
,	O
including	O
Burroughs	B-Device
B5000	I-Device
Algol	B-Language
,	O
PL/I	B-Language
,	O
C	B-Language
,	O
LISP	B-Language
,	O
and	O
Java	B-Language
.	O
</s>
<s>
The	O
language	O
is	O
first	O
implemented	O
by	O
a	O
temporary	O
compiler	O
written	O
in	O
some	O
other	O
language	O
,	O
or	O
even	O
by	O
an	O
interpreter	O
(	O
often	O
an	O
interpreter	O
for	O
an	O
intermediate	O
code	O
,	O
as	O
BCPL	B-Language
can	O
do	O
with	O
intcode	O
or	O
O-code	B-Language
)	O
.	O
</s>
<s>
XCOM	O
began	O
as	O
an	O
Algol	B-Language
program	O
running	O
on	O
Burroughs	O
machines	O
,	O
translating	O
XPL	B-Language
source	O
code	O
into	O
System/360	B-Application
machine	B-Language
code	I-Language
.	O
</s>
<s>
The	O
XPL	B-Language
team	O
manually	O
turned	O
its	O
Algol	B-Language
source	O
code	O
into	O
XPL	B-Language
source	O
code	O
.	O
</s>
<s>
That	O
XPL	B-Language
version	O
of	O
XCOM	O
was	O
then	O
compiled	O
on	O
Burroughs	O
,	O
creating	O
a	O
self-compiling	O
XCOM	O
for	O
System/360	B-Application
machines	O
.	O
</s>
<s>
The	O
Algol	B-Language
version	O
was	O
then	O
thrown	O
away	O
,	O
and	O
all	O
further	O
improvements	O
happened	O
in	O
the	O
XPL	B-Language
version	O
only	O
.	O
</s>
<s>
This	O
is	O
called	O
bootstrapping	B-Application
the	O
compiler	O
.	O
</s>
<s>
The	O
authors	O
of	O
XPL	B-Language
invented	O
the	O
tombstone	B-Application
diagram	I-Application
or	O
T-diagram	B-Application
to	O
document	O
the	O
bootstrapping	B-Application
process	O
.	O
</s>
<s>
Retargeting	B-Application
the	O
compiler	O
for	O
a	O
new	O
machine	O
architecture	O
is	O
a	O
similar	O
exercise	O
,	O
except	O
only	O
the	O
code	B-Application
generation	I-Application
modules	O
need	O
to	O
be	O
changed	O
.	O
</s>
<s>
XCOM	O
is	O
a	O
one-pass	B-Language
compiler	I-Language
(	O
but	O
with	O
an	O
emitted	O
code	O
fix-up	O
process	O
for	O
forward	O
branches	O
,	O
loops	O
and	O
other	O
defined	O
situations	O
)	O
.	O
</s>
<s>
It	O
emits	O
machine	B-Language
code	I-Language
for	O
each	O
statement	O
as	O
each	O
grammar	O
rule	O
within	O
a	O
statement	O
is	O
recognized	O
,	O
rather	O
than	O
waiting	O
until	O
it	O
has	O
parsed	O
the	O
entire	O
procedure	O
or	O
entire	O
program	O
.	O
</s>
<s>
The	O
code	B-Application
generation	I-Application
response	O
to	O
each	O
grammar	O
rule	O
is	O
attached	O
to	O
that	O
rule	O
.	O
</s>
<s>
The	O
XCOM	O
compiler	O
has	O
a	O
hand-written	O
lexical	B-Application
scanner	I-Application
and	O
a	O
mechanically-generated	O
parser	B-Language
.	O
</s>
<s>
The	O
syntax	O
of	O
the	O
compiler	O
's	O
input	O
language	O
(	O
in	O
this	O
case	O
,	O
XPL	B-Language
)	O
is	O
described	O
by	O
a	O
simplified	O
BNF	O
grammar	O
.	O
</s>
<s>
XPL	B-Language
's	O
grammar	O
analyzer	O
tool	O
ANALYZER	O
or	O
XA	O
turns	O
this	O
into	O
a	O
set	O
of	O
large	O
data	O
tables	O
describing	O
all	O
legal	O
combinations	O
of	O
the	O
syntax	O
rules	O
and	O
how	O
to	O
discern	O
them	O
.	O
</s>
<s>
This	O
style	O
of	O
table-driven	O
parser	B-Language
is	O
generally	O
easier	O
to	O
write	O
than	O
an	O
entirely	O
hand-written	O
recursive	B-Application
descent	I-Application
parser	I-Application
.	O
</s>
<s>
XCOM	O
uses	O
a	O
bottom-up	B-Application
parsing	I-Application
method	O
,	O
in	O
which	O
the	O
compiler	O
can	O
delay	O
its	O
decision	O
about	O
which	O
syntax	O
rule	O
it	O
has	O
encountered	O
until	O
it	O
has	O
seen	O
the	O
rightmost	O
end	O
of	O
that	O
phrase	O
.	O
</s>
<s>
This	O
handles	O
a	O
wider	O
range	O
of	O
programming	O
languages	O
than	O
top-down	B-Application
methods	O
,	O
in	O
which	O
the	O
compiler	O
must	O
guess	O
or	O
commit	O
to	O
a	O
specific	O
syntax	O
rule	O
early	O
,	O
when	O
it	O
has	O
only	O
seen	O
the	O
left	O
end	O
of	O
a	O
phrase	O
.	O
</s>
<s>
XPL	B-Language
includes	O
a	O
minimal	O
runtime	O
support	O
library	O
for	O
allocating	O
and	O
garbage-collecting	O
XPL	B-Language
string	O
values	O
.	O
</s>
<s>
The	O
source	O
code	O
for	O
this	O
library	O
must	O
be	O
included	O
into	O
most	O
every	O
program	O
written	O
in	O
XPL	B-Language
.	O
</s>
<s>
The	O
last	O
piece	O
of	O
the	O
XPL	B-Language
compiler	O
writing	O
system	O
is	O
an	O
example	O
compiler	O
named	O
SKELETON	O
.	O
</s>
<s>
This	O
is	O
just	O
XCOM	O
with	O
parse	O
tables	O
for	O
an	O
example	O
toy	O
grammar	O
instead	O
of	O
XPL	B-Language
's	O
full	O
grammar	O
.	O
</s>
<s>
It	O
is	O
a	O
starting	O
point	O
for	O
building	O
a	O
compiler	O
for	O
some	O
new	O
language	O
,	O
if	O
that	O
language	O
differs	O
much	O
from	O
XPL	B-Language
.	O
</s>
<s>
XPL	B-Language
is	O
run	O
under	O
the	O
control	O
of	O
a	O
monitor	O
,	O
XMON	O
,	O
which	O
is	O
the	O
only	O
operating	O
system-specific	O
part	O
of	O
this	O
system	O
,	O
and	O
which	O
acts	O
as	O
a	O
"	O
loader	O
"	O
for	O
XCOM	O
itself	O
or	O
any	O
programs	O
which	O
were	O
developed	O
using	O
XCOM	O
,	O
and	O
also	O
provides	O
three	O
auxiliary	O
storage	O
devices	O
for	O
XCOM	O
's	O
use	O
,	O
and	O
which	O
are	O
directly	O
accessed	O
by	O
block	O
number	O
.	O
</s>
<s>
Converting	O
XMON	O
from	O
its	O
primitive	O
use	O
of	O
NOTE	O
,	O
POINT	O
and	O
READ/WRITE	O
disk	O
operations	O
—	O
with	O
precisely	O
1	O
block	O
per	O
track	O
—	O
to	O
EXCP	B-Application
(	O
i.e.	O
,	O
write/create	O
new	O
records	O
)	O
and	O
XDAP	B-Application
(	O
i.e.	O
,	O
read/update	O
old	O
records	O
)	O
—	O
with	O
n	O
blocks	O
per	O
track	O
,	O
where	O
n	O
was	O
computed	O
at	O
run-time	O
from	O
the	O
target	O
device	O
's	O
physical	O
characteristics	O
and	O
could	O
be	O
significantly	O
greater	O
than	O
1	O
—	O
achieved	O
significantly	O
improved	O
application	O
performance	O
and	O
decreased	O
operating	O
system	O
overhead	O
.	O
</s>
<s>
Although	O
originally	O
developed	O
for	O
OS/360	B-Application
,	O
XMON	O
(	O
either	O
the	O
original	O
NOTE	O
,	O
POINT	O
and	O
READ/WRITE	O
implementation	O
;	O
or	O
the	O
EXCP	B-Application
and	O
XDAP	B-Application
enhancement	O
)	O
will	O
run	O
on	O
subsequently	O
released	O
IBM	O
OSes	O
,	O
including	O
OS/370	O
,	O
XA	O
,	O
OS/390	B-Application
and	O
z/OS	B-Application
,	O
generally	O
without	O
any	O
changes	O
.	O
</s>
<s>
XCOM	O
originally	O
used	O
a	O
now-obsolete	O
bottom-up	O
parse	O
table	O
method	O
called	O
Mixed	O
Strategy	O
Precedence	O
,	O
invented	O
by	O
the	O
XPL	B-Language
team	O
(	O
although	O
the	O
officially	O
released	O
version	O
retains	O
the	O
MSP	O
parser	B-Language
and	O
does	O
not	O
include	O
later-released	O
"	O
peephole	O
optimizations	O
"	O
and	O
additional	O
data	O
types	O
which	O
were	O
developed	O
outside	O
of	O
the	O
original	O
implementation	O
team	O
.	O
)	O
</s>
<s>
MSP	O
is	O
a	O
generalization	O
of	O
the	O
simple	B-Application
precedence	I-Application
parser	I-Application
method	O
invented	O
by	O
Niklaus	O
Wirth	O
for	O
PL360	B-Language
.	O
</s>
<s>
Simple	O
precedence	O
is	O
itself	O
a	O
generalization	O
of	O
the	O
trivially	O
simple	O
operator	O
precedence	O
methods	O
that	O
work	O
nicely	O
for	O
expressions	O
like	O
A+B*( C+D	O
)	O
-E	O
.	O
MSP	O
tables	O
include	O
a	O
list	O
of	O
expected	O
triplets	O
of	O
language	O
symbols	O
.	O
</s>
<s>
XPL-derived	O
compilers	O
were	O
difficult	O
to	O
fit	O
onto	O
minicomputers	O
of	O
the	O
1970s	O
with	O
limited	O
memories	O
.	O
</s>
<s>
The	O
University	O
of	O
Toronto	O
subsequently	O
changed	O
XCOM	O
and	O
XA	O
to	O
instead	O
use	O
a	O
variant	O
of	O
Donald	O
Knuth	O
's	O
LR	B-Application
parser	I-Application
bottom-up	O
method	O
.	O
</s>
<s>
XCOM	O
's	O
variant	O
is	O
called	O
Simple	B-Application
LR	I-Application
or	O
SLR	O
.	O
</s>
<s>
It	O
handles	O
more	O
grammars	O
than	O
MSP	O
but	O
not	O
quite	O
as	O
many	O
grammars	O
as	O
LALR	B-Application
or	O
full	O
LR(1 )	O
.	O
</s>
<s>
The	O
differences	O
from	O
LR(1 )	O
are	O
mostly	O
in	O
the	O
table	O
generator	O
's	O
algorithms	O
,	O
not	O
in	O
the	O
compile-time	O
parser	B-Language
method	O
.	O
</s>
<s>
XCOM	O
and	O
XA	O
predate	O
the	O
widespread	O
availability	O
of	O
Unix	O
and	O
its	O
yacc	B-Application
parser	B-Language
generator	I-Language
tool	O
.	O
</s>
<s>
XA	O
and	O
yacc	B-Application
have	O
similar	O
purposes	O
.	O
</s>
<s>
XPL	B-Language
is	O
open	O
source	O
.	O
</s>
<s>
The	O
System/360	B-Application
version	O
of	O
XPL	B-Language
was	O
distributed	O
through	O
the	O
IBM	O
SHARE	O
users	O
organization	O
.	O
</s>
<s>
Other	O
groups	O
ported	O
XPL	B-Language
onto	O
many	O
of	O
the	O
larger	O
machines	O
of	O
the	O
1970s	O
.	O
</s>
<s>
Various	O
groups	O
extended	O
XPL	B-Language
,	O
or	O
used	O
XPL	B-Language
to	O
implement	O
other	O
moderate-sized	O
languages	O
.	O
</s>
<s>
XPL	B-Language
has	O
been	O
used	O
to	O
develop	O
a	O
number	O
of	O
compilers	O
for	O
various	O
languages	O
and	O
systems	O
.	O
</s>
<s>
XPL	B-Language
continues	O
to	O
be	O
ported	O
to	O
current	O
computers	O
.	O
</s>
<s>
An	O
x86/FreeBSD	O
port	O
was	O
done	O
in	O
2000	O
,	O
an	O
x86/Linux	O
port	O
in	O
2015	O
,	O
and	O
an	O
XPL	B-Language
to	O
C	B-Language
translator	B-Application
in	O
2017	O
.	O
</s>
