Panic-Mode (Hartmann) Error Recovery
51/57
S
A
1
x
a wrong token
X
1
A
3
X
3
A
2
X
2
Let
Context
(
A
1
) =
Follow
(
A
1
)
È
Follow
(
A
2
)
È
Follow
(
A
n
)
=
A
n
repeat
a
:= GetNextToken;
{These tokens are skipped}
until
a
in
Context
(
A
1
)
if
a
in
Follow
(
A
i
)
then
continue with parsing from
the symbol
X
i
.