Slide 51
Slide 51 text
Shared Packed Parse Forest (SPPF)
S ::= 'a' S 'b'
| 'a' S
| 's'
"aasb"
S, 0, 4
a, 0, 1 S, 1, 3 b, 3, 4
a, 1, 2 S, 2, 3
s, 2, 3
S, 1, 4
S, 0, 4
a, 0, 1
S, 2, 3
s, 2, 3
a, 1, 2 b, 3, 4
s, 2, 3 s, 2, 3
Figure 1: Two parse trees (left) and their corresponding SPPF (r
To enable general context-free parsing in O(n3) without manu
ing the grammar, Scott and Johnstone [18] introduced the notio
SPPFs, which use additional intermediate nodes. Intermediate
the form (L, i, j) where L is a grammar position and i and j are
extents. Grammar positions for intermediate nodes are of the fo
where |↵| >= 2. For example, S ::= aS · b for the rule S ::= aSb.
version of SPPF in Figure 1 is shown in Figure 2. Intermediate
similar to nonterminal nodes, can be ambiguous, in which case h
one packed nodes as children.
S, 0, 4
a, 0, 1 S, 1, 3 b, 3, 4
a, 1, 2 S, 2, 3
s, 2, 3
S, 1, 4
S ::= aS · b, 0, 3
S ::= aS · b, 1, 3
Figure 2: Binarized SPPF
Packed nodes in a binarized SPPF are of the form (L, k), where L