Closed patrickhuber closed 8 years ago
The aycock horspool algorithm isn't producing the correct parse node when the last symbol in a grammar is nullable.
grammar
S-> ST | 'a'; B-> ; T-> 'a' B | 'a';
input
aa
expected tree
(S, 0, 2) = (S, 0, 1) (T, 1, 2); (S, 0, 1) = ("a", 0, 1); (T, 1, 2) = ("a", 1, 2) | ("a", 1, 2) (B, 2, 2); (B, 2, 2) = ("", 2, 2);
E-> F | FE | ; F-> a ;
(E, 0, 2) = (E, 0, 1) (E, 1, 2); (E, 0, 1) = (F, 0, 1) | (F, 0, 1) (E, 1, 1); (F, 0, 1) = ("a", 0, 1); (E, 1, 1) = ("", 1, 1); (E, 1, 2) = (F, 1, 2) | (F, 1, 2) (E, 2, 2); (E, 2, 2) = ("", 1, 1); (F, 1, 2) = ("a", 1, 2);
The aycock horspool algorithm isn't producing the correct parse node when the last symbol in a grammar is nullable.
example 1
grammar
input
expected tree
example 2
grammar
input
expected tree