<s>
A	O
lookahead	B-Application
LR	I-Application
parser	I-Application
(	O
LALR	B-Application
)	O
generator	O
is	O
a	O
software	O
tool	O
that	O
reads	O
a	O
BNF	O
grammar	O
and	O
creates	O
an	O
LALR	B-Application
parser	I-Application
which	O
is	O
capable	O
of	O
parsing	O
files	O
written	O
in	O
the	O
computer	B-Language
language	I-Language
defined	O
by	O
the	O
BNF	O
grammar	O
.	O
</s>
<s>
LALR	B-Application
parsers	I-Application
are	O
desirable	O
because	O
they	O
are	O
very	O
fast	O
and	O
small	O
in	O
comparison	O
to	O
other	O
types	O
of	O
parsers	O
.	O
</s>
<s>
There	O
are	O
other	O
types	O
of	O
parser	B-Language
generators	I-Language
,	O
such	O
as	O
Simple	B-Application
LR	I-Application
parser	I-Application
,	O
LR	B-Application
parser	I-Application
,	O
GLR	B-Application
parser	I-Application
,	O
LL	B-Language
parser	I-Language
and	O
GLL	O
parser	B-Language
generators	I-Language
.	O
</s>
<s>
An	O
LALR	B-Application
parser	I-Application
generator	I-Application
accepts	O
an	O
LALR	B-Application
grammar	O
as	O
input	O
and	O
generates	O
a	O
parser	O
that	O
uses	O
an	O
LALR	B-Application
parsing	I-Application
algorithm	O
(	O
which	O
is	O
driven	O
by	O
LALR	B-Application
parser	I-Application
tables	O
)	O
.	O
</s>
<s>
In	O
practice	O
,	O
LALR	B-Application
offers	O
a	O
good	O
solution	O
,	O
because	O
LALR(1 )	O
grammars	O
are	O
more	O
powerful	O
than	O
SLR(1 )	O
,	O
and	O
can	O
parse	O
most	O
practical	O
LL(1 )	O
grammars	O
.	O
</s>
<s>
LR(1 )	O
grammars	O
are	O
more	O
powerful	O
than	O
LALR(1 )	O
,	O
but	O
canonical	O
LR(1 )	O
parsers	O
can	O
be	O
extremely	O
large	O
in	O
size	O
and	O
are	O
considered	O
not	O
practical	O
.	O
</s>
<s>
Minimal	O
LR(1 )	O
parsers	O
are	O
small	O
in	O
size	O
and	O
comparable	O
to	O
LALR(1 )	O
parsers	O
.	O
</s>
<s>
Frank	O
DeRemer	O
invented	O
LALR	B-Application
parsers	I-Application
with	O
his	O
PhD	O
dissertation	O
,	O
called	O
"	O
Practical	O
LR(k )	O
Translators	O
"	O
,	O
in	O
1969	O
,	O
at	O
MIT	O
.	O
</s>
<s>
An	O
early	O
LALR	B-Application
parser	I-Application
generator	I-Application
and	O
probably	O
the	O
most	O
popular	O
one	O
for	O
many	O
years	O
was	O
"	O
yacc	B-Application
"	O
(	O
Yet	B-Application
Another	I-Application
Compiler	I-Application
Compiler	I-Application
)	O
,	O
created	O
by	O
Stephen	O
Johnson	O
in	O
1975	O
at	O
AT&T	O
Labs	O
.	O
</s>
<s>
Today	O
,	O
there	O
are	O
many	O
LALR	B-Application
parser	I-Application
generators	I-Application
available	O
,	O
many	O
inspired	O
by	O
and	O
largely	O
compatible	O
with	O
the	O
original	O
Yacc	B-Application
,	O
for	O
example	O
GNU	B-Application
bison	I-Application
,	O
a	O
pun	O
on	O
the	O
original	O
Yacc/Yak	O
.	O
</s>
<s>
See	O
Comparison	O
of	O
deterministic	O
context-free	O
language	O
parser	B-Language
generators	I-Language
for	O
a	O
more	O
detailed	O
list	O
.	O
</s>
<s>
The	O
LALR	B-Application
parser	I-Application
and	O
its	O
alternatives	O
,	O
the	O
SLR	B-Application
parser	I-Application
and	O
the	O
Canonical	B-Application
LR	I-Application
parser	I-Application
,	O
have	O
similar	O
methods	O
and	O
parsing	O
tables	O
;	O
their	O
main	O
difference	O
is	O
in	O
the	O
mathematical	O
grammar	O
analysis	O
algorithm	O
used	O
by	O
the	O
parser	O
generation	O
tool	O
.	O
</s>
<s>
LALR	B-Application
generators	O
accept	O
more	O
grammars	O
than	O
do	O
SLR	O
generators	O
,	O
but	O
fewer	O
grammars	O
than	O
full	O
LR(1 )	O
.	O
</s>
<s>
Full	O
LR	O
involves	O
much	O
larger	O
parse	O
tables	O
and	O
is	O
avoided	O
unless	O
clearly	O
needed	O
for	O
some	O
particular	O
computer	B-Language
language	I-Language
.	O
</s>
<s>
Real	O
computer	B-Language
languages	I-Language
can	O
often	O
be	O
expressed	O
as	O
LALR(1 )	O
grammars	O
.	O
</s>
<s>
In	O
cases	O
where	O
they	O
ca	O
n't	O
,	O
a	O
LALR(2 )	O
grammar	O
is	O
usually	O
adequate	O
.	O
</s>
<s>
If	O
the	O
parser	B-Language
generator	I-Language
allows	O
only	O
LALR(1 )	O
grammars	O
,	O
the	O
parser	O
typically	O
calls	O
some	O
hand-written	O
code	O
whenever	O
it	O
encounters	O
constructs	O
needing	O
extended	O
lookahead	O
.	O
</s>
<s>
Similar	O
to	O
an	O
SLR	B-Application
parser	I-Application
and	O
Canonical	B-Application
LR	I-Application
parser	I-Application
generator	O
,	O
an	O
LALR	B-Application
parser	I-Application
generator	I-Application
constructs	O
the	O
LR(0 )	O
state	O
machine	O
first	O
and	O
then	O
computes	O
the	O
lookahead	O
sets	O
for	O
all	O
rules	O
in	O
the	O
grammar	O
,	O
checking	O
for	O
ambiguity	O
.	O
</s>
<s>
The	O
Canonical	B-Application
LR	I-Application
constructs	O
full	O
lookahead	O
sets	O
.	O
</s>
<s>
LALR	B-Application
uses	O
merge	O
sets	O
,	O
that	O
is	O
it	O
merges	O
lookahead	O
sets	O
where	O
the	O
LR(0 )	O
core	O
is	O
the	O
same	O
.	O
</s>
<s>
This	O
is	O
a	O
greater	O
simplification	O
than	O
that	O
in	O
the	O
case	O
of	O
LALR	B-Application
because	O
many	O
conflicts	O
may	O
arise	O
from	O
LR(0 )	O
cores	O
sharing	O
the	O
same	O
right	O
hand	O
side	O
and	O
lookahead	O
terminal	O
,	O
conflicts	O
which	O
are	O
not	O
present	O
in	O
LALR	B-Application
.	O
</s>
<s>
This	O
is	O
why	O
SLR	O
has	O
less	O
language	O
recognition	O
power	O
than	O
LALR	B-Application
with	O
Canonical	B-Application
LR	I-Application
being	O
stronger	O
than	O
both	O
since	O
it	O
does	O
not	O
include	O
any	O
simplifications	O
.	O
</s>
