<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
recursive	B-Application
ascent	I-Application
parsing	O
is	O
a	O
technique	O
for	O
implementing	O
an	O
LALR	B-Application
parser	I-Application
which	O
uses	O
mutually-recursive	O
functions	O
rather	O
than	O
tables	O
.	O
</s>
<s>
Thus	O
,	O
the	O
parser	O
is	O
directly	O
encoded	O
in	O
the	O
host	O
language	O
similar	O
to	O
recursive	B-Application
descent	I-Application
.	O
</s>
<s>
It	O
is	O
also	O
(	O
nominally	O
)	O
possible	O
to	O
hand	O
edit	O
a	O
recursive	B-Application
ascent	I-Application
parser	I-Application
,	O
whereas	O
a	O
tabular	O
implementation	O
is	O
nigh	O
unreadable	O
to	O
the	O
average	O
human	O
.	O
</s>
<s>
Recursive	B-Application
ascent	I-Application
was	O
first	O
described	O
by	O
Thomas	O
Pennello	O
in	O
his	O
article	O
in	O
1986	O
.	O
</s>
<s>
He	O
was	O
not	O
intending	O
to	O
create	O
a	O
hand-editable	O
implementation	O
of	O
an	O
LR	B-Application
parser	I-Application
,	O
but	O
rather	O
a	O
maintainable	O
and	O
efficient	O
parser	O
implemented	O
in	O
assembly	B-Language
language	I-Language
.	O
</s>
<s>
Roberts	O
in	O
1988	O
as	O
well	O
as	O
in	O
an	O
article	O
by	O
Leermakers	O
,	O
Augusteijn	O
,	O
Kruseman	O
Aretz	O
in	O
1992	O
in	O
the	O
journal	O
Theoretical	O
Computer	B-General_Concept
Science	I-General_Concept
.	O
</s>
<s>
Recursive	B-Application
ascent	I-Application
has	O
also	O
been	O
merged	O
with	O
recursive	B-Application
descent	I-Application
,	O
yielding	O
a	O
technique	O
known	O
as	O
recursive	O
ascent/descent	O
.	O
</s>
<s>
It	O
can	O
also	O
yield	O
some	O
minimal	O
performance	O
improvements	O
over	O
conventional	O
recursive	B-Application
ascent	I-Application
.	O
</s>
<s>
Intuitively	O
,	O
recursive	B-Application
ascent	I-Application
is	O
a	O
literal	O
implementation	O
of	O
the	O
LR	B-Application
parsing	I-Application
concept	O
.	O
</s>
<s>
Each	O
function	O
in	O
the	O
parser	O
represents	O
a	O
single	O
LR	O
automaton	B-Architecture
state	O
.	O
</s>
<s>
Shift	O
-	O
Encoded	O
as	O
a	O
function	O
call	O
,	O
effectively	O
jumping	O
to	O
a	O
new	O
automaton	B-Architecture
state	O
.	O
</s>
<s>
Reduce	O
-	O
Encoded	O
differently	O
according	O
to	O
the	O
semantic	B-Language
action	I-Language
routine	I-Language
for	O
the	O
relevant	O
production	O
.	O
</s>
<s>
There	O
is	O
also	O
a	O
third	O
LR	O
automaton	B-Architecture
action	O
which	O
may	O
be	O
taken	O
in	O
a	O
given	O
state	O
,	O
but	O
only	O
after	O
a	O
reduce	O
where	O
the	O
shift	O
counter	O
has	O
decremented	O
to	O
zero	O
(	O
indicating	O
that	O
the	O
current	O
state	O
should	O
handle	O
the	O
result	O
)	O
.	O
</s>
<s>
Consider	O
the	O
following	O
grammar	O
in	O
bison	B-Application
syntax	O
:	O
</s>
<s>
Recursive	B-Application
ascent	I-Application
is	O
also	O
capable	O
of	O
handling	O
grammars	O
which	O
are	O
LALR(1 )	O
in	O
much	O
the	O
same	O
way	O
that	O
table-driven	O
parsers	O
handle	O
such	O
cases	O
(	O
by	O
pre-computing	O
conflict	O
resolutions	O
based	O
on	O
possible	O
lookahead	O
)	O
.	O
</s>
<s>
The	O
following	O
is	O
a	O
Scala	B-Application
implementation	O
of	O
a	O
recursive	B-Application
ascent	I-Application
parser	I-Application
based	O
on	O
the	O
above	O
grammar	O
:	O
</s>
<s>
The	O
following	O
is	O
a	O
Prolog	B-Language
implementation	O
of	O
a	O
recursive	B-Application
ascent	I-Application
parser	I-Application
based	O
on	O
the	O
above	O
grammar	O
:	O
</s>
